compose文件:
version: '2' services: consul-server: image: gliderlabs/consul-server:0.6 command: -bootstrap -advertise 192.168.10.138 hostname: consul-server ports: - "8400:8400" - "8500:8500" - "8600:53/udp" registrator: image: gliderlabs/registrator:latest command: consul://consul-server:8500 hostname: registrator depends_on: - consul-server volumes: - /var/run/docker.sock:/tmp/docker.sock app: image: tutum/hello-world:latest environment: # Environment variables used by registrator to register services in consul SERVICE_NAME: app SERVICE_TAGS: sample ports: - "8081:80" depends_on: - consul-template-nginx # Nginx Load Balancer consul-template-nginx: image: 1science/nginx:1.9.6-consul ports: - 80:80 volumes: - ./etc/consul-template:/etc/consul-tem