docker consul 安装部署

FROM docker.io/openshift/base-centos7
MAINTAINER hanyinting
RUN yum install curl unzip -y


ADD consul_0.6.4_linux_amd64.zip /tmp/consul.zip
RUN cd /usr/sbin && unzip /tmp/consul.zip && chmod +x /usr/sbin/consul && rm /tmp/consul.zip


RUN mkdir -p /webui/
ADD consul_0.6.4_web_ui.zip /webui/webui.zip
RUN cd /webui && unzip webui.zip && rm webui.zip


ADD consul.json /config/


EXPOSE 53/udp 8300 8301 8301/udp 8302 8302/udp 8400 8500


VOLUME ["/data"]


ENTRYPOINT [ "/usr/sbin/consul", "agent", "-config-dir=/config" ]

CMD []




consul.json

{
  "data_dir": "/data",
  "ui_dir": "/webui",
  "client_addr": "0.0.0.0",
  "ports": {
    "dns": 53
  },
  "recursor": "8.8.8.8"
}




docker run -d -p 8500:8500 -p 53:53/udp -h node1 consul:v1 -server -bootstrap





consul的下载地址

https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_linux_amd64.zip


你可能感兴趣的:(运维)