cat > Dockerfile<<EOF
FROM centos:7
RUN yum clean all
RUN yum repolist
RUN yum -y install vim iproute net-tools psmisc openssh-server initscripts openssh-clients wget java-1.8.0-openjdk git
RUN sshd-keygen
RUN sed -ir ‘/StrictHostKeyChecking/cStrictHostKeyChecking no’ /etc/ssh/ssh_config
RUN echo “123456”|passwd –stdin root
ENV EnvironmentFile=/etc/sysconfig/sshd
EXPOSE 22 9100 9200 9300 9600 6379 27017 1-10000
CMD [“/usr/sbin/sshd”, “-D”]
EOF
docker build -t myos:zabbix .
docker network create –subnet=192.168.1.0/24 -o com.docker.network.bridge.name=zabbix zabbix
docker run -d –ip 192.168.1.10 –network zabbix –name zb01 -h zb01 -p 80:80 -p 3306:3306 –privileged myos:zabbix init
docker run -d –ip 192.168.1.20 –network zabbix –name zb02 -h zb02 -p 81:80 -p 3307:3306 –privileged myos:zabbix init

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注