**Apache Airflow version**: 2.0.0

**Kubernetes version (if you are using kubernetes)** (use `kubectl version`): NA

**Environment**: 
* local Ubuntu 18.04 LTS / 
* docker-compose version 1.25.3, build d4d1b42b
* docker  20.10.1, build 831ebea

**What happened**:

when enabling xcom push for a docker operator the following error is thrown after the task finishes succesfully:
`TypeError: Object of type bytes is not JSON serializable`


**What you expected to happen**:

* error is not thrown
* if xcom_all is True: xcom contains all log lines
* if xcom_all is False: xcom contains last log line


**How to reproduce it**:

see docker compose and readme here:
https://github.com/AlessioM/airflow-xcom-issue

airflow/providers/docker/operators/docker.py
self.cli = self._get_cli()
        if not self.cli:
            raise Exception("The 'cli' should be initialized before!")
        
        if self.force_pull or not self.cli.images(name=self.image):
            self.log.info('Pulling docker image %s', self.image)
            latest_status = {}
            for output in self.cli.pull(self.image, stream=True, decode=True):
                if isinstance(output, str):
                    self.log.info("%s", output)
                    continue
                if isinstance(output, dict) and 'status' in output:
                    output_status = output["status"]
                    if 'id' not in output:
                        self.log.info("%s", output_status)
                        continue
                    output_id = output["id"]
                    if latest_status.get(output_id) != output_status:
                        self.log.info("%s: %s", output_id, output_status)
                        latest_status[output_id] = output_status
        return self._run_image()
    def _get_cli(self) -> APIClient:
        if self.docker_conn_id:
            return self.get_hook().get_conn()
        else:
            tls_config = self.__get_tls_config()
            return APIClient(base_url=self.docker_url, version=self.api_version, tls=tls_config)
    @staticmethod
    def format_command(command: Union[str, List[str]]) -> Union[List[str], str]: