**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
detect the server's version.
    :type api_version: str
    :param command: Command to be run in the container. (templated)
    :type command: str or list
    :param container_name: Name of the container. Optional (templated)
    :type container_name: str or None
    :param cpus: Number of CPUs to assign to the container.
        This value gets multiplied with 1024. See
        https://docs.docker.com/engine/reference/run/#cpu-share-constraint
    :type cpus: float
    :param docker_url: URL of the host running the docker daemon.
        Default is unix://var/run/docker.sock
    :type docker_url: str
    :param environment: Environment variables to set in the container. (templated)
    :type environment: dict
    :param private_environment: Private environment variables to set in the container.
        These are not templated, and hidden from the website.
    :type private_environment: dict
    :param force_pull: Pull the docker image on every run. Default is False.
    :type force_pull: bool
    :param mem_limit: Maximum amount of memory the container can use.
        Either a float value, which represents the limit in bytes,
        or a string like ``128m`` or ``1g``.
    :type mem_limit: float or str
    :param host_tmp_dir: Specify the location of the temporary directory on the host which will
        be mapped to tmp_dir. If not provided defaults to using the standard system temp directory.
    :type host_tmp_dir: str
    :param network_mode: Network mode for the container.
    :type network_mode: str
    :param tls_ca_cert: Path to a PEM-encoded certificate authority