This is an example docker-compose.yml for the Confluent Platform.
In order to properly use this docker-compose make sure that your containers are resolvable by their container name. Take a look at the hosts file. Each container must be resolvable from the host machine if you are connecting from the host to the docker environment.