docker-compose
- 여러개의 컨테이너로부터 이루어진 서비스를 구축할때 사용한다.
Kafka docker-compose.yml 생성
- kafka 브로커를 이용할때 정확한 IP가 필요해서 IP 설정 필요
version: '2'
services:
zookeeper:
image: gugbab/zookeeper
ports:
- "2181:2181"
networks:
my-network:
ipv4_address: 172.18.0.100
kafka:
image: gugbab/kafka
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: 172.18.0.100
KAFKA_CREATE_TOPICS: "gugbab_test:1:1"
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- zookeeper
networks:
my-network:
ipv4_address: 172.18.0.101
networks:
my-network:
name: gugbab-network
docker-compose 실행
- docker-compose -f [파일명] up -d
컨테이너 생성 결과
'DevOps' 카테고리의 다른 글
[CICD] Docker Container - Jenkins Start Example (0) | 2023.06.05 |
---|---|
[Dcoker] Zipkin, Monitoring(Prometheus + Grafana) Container Create Example (0) | 2023.05.31 |
[Docker] MariaDb Docker Create Connect Example (0) | 2023.05.27 |
[Docker] RabbitMq Docker Create Connect Example (0) | 2023.05.22 |
[Docker] Bridge Network Create Example (0) | 2023.05.20 |