示例 docker-compose.yml
version: "3.9"
services:
ubuntu1:
container_name: ubuntu1
image: ubuntu:18.04
hostname: ubuntu1
command: ["tail","-f","/dev/null"]
networks:
clickhouse_net:
ipv4_address: 172.16.0.10
ubuntu2:
container_name: ubuntu2
image: ubuntu:18.04
hostname: ubuntu2
command: ["tail","-f","/dev/null"]
networks:
clickhouse_net:
ipv4_address: 172.16.0.11
ubuntu3:
container_name: ubuntu3
image: ubuntu:18.04
hostname: ubuntu3
command: ["tail","-f","/dev/null"]
networks:
clickhouse_net:
ipv4_address: 172.16.0.12
networks:
clickhouse_net:
driver: bridge
ipam:
config:
- subnet: 172.16.0.0/24
gateway: 172.16.0.1