Forked from cmeiklejohn/gist:02ef7ed8ff8a7aaa4e02d353ecbf3ada
Last active
May 21, 2018 18:45
-
-
Save ringods/b1877c9c34933a89e48b5b8e15174009 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
zookeeper: | |
image: "confluentinc/cp-zookeeper:4.1.0" | |
ports: | |
- "2181:2181" | |
expose: | |
- "2181" | |
environment: | |
- ZOOKEEPER_CLIENT_PORT=2181 | |
kafka: | |
image: "confluentinc/cp-kafka:4.1.0" | |
hostname: kafka | |
links: | |
- zookeeper | |
ports: | |
- "9092:9092" | |
expose: | |
- "9092" | |
environment: | |
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 | |
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://zookeeper:9092 | |
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cmeiklejohn when using Docker compose, each of the docker containers gets an
/etc/hosts
file pre-filled with the hostnames pointing to your services:zookeeper
&kafka
. When resolving one service from the other, just use the service name you specified in yourdocker-compose.yml
.