docker-compose安装consul

环境:
系统版本: centos7
docker版本:18.06.1-ce
docker-compose版本: 1.24.0

docker-compose.yml配置如下:

version: '3'
services:
  consul:
    image: harbor.xxx.com/xxx/consul:latest
    volumes:
      - /home/test/consul/data:/consul/data
      - /home/test/consul/config:/consul/config
    ports:
      - 8300:8300
      - 8301:8301
      - 8301:8301/udp
      - 8302:8302
      - 8302:8302/udp
      - 8400:8400
      - 8500:8500
      - 53:53/udp
    command: agent -server -bind=0.0.0.0 -client=0.0.0.0 -node=consul_Server1 -bootstrap-expect=1 -ui

启动容器:

docker-compose up -d

滚动启动:

docker-compose pull && docker-compose up -d

如果yml配置名不叫docker-compose.yml的话,运行命令请参考:https://blog.csdn.net/zhujuntiankong/article/details/94430955

你可能感兴趣的:(docker学习笔记,consul)