github.com/gogf/gkafka@v1.0.1-0.20190702070843-033a14468069/main/run-kafka-in-docker.sh (about) 1 #!/bin/sh 2 3 # clear 4 sudo docker rm $(sudo docker ps -a -q) 5 6 # zookeeper 7 sudo docker run -d --name zookeeper -p 2181 -t wurstmeister/zookeeper 8 9 # kafka 10 sudo docker run -d --name kafka --publish 9092:9092 --link zookeeper --env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 --env KAFKA_ADVERTISED_HOST_NAME=127.0.0.1 --env KAFKA_ADVERTISED_PORT=9092 wurstmeister/kafka:latest