Dockerfile
FROM centos:7
MAINTAINER zhangqijun "qijundada01@163.com" "qq:68327349"
RUN yum update -y
RUN yum repolist
RUN yum -y install vim iproute net-tools psmisc openssh-server initscripts openssh-clients wget lrzsz ansible
RUN ssh-keygen -N "" -f /root/.ssh/id_rsa
RUN sshd-keygen
RUN cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
RUN sed -ir '/StrictHostKeyChecking/cStrictHostKeyChecking no' /etc/ssh/ssh_config
RUN echo "123456"|passwd --stdin root
ENV EnvironmentFile=/etc/sysconfig/sshd
ADD jdk-8u201-linux-x64.tar.gz /usr/local/ 
ENV JAVA_HOME /usr/local/jdk1.8.0_201
ENV PATH $PATH:$JAVA_HOME/bin
RUN useradd zqj
RUN echo "123456"|passwd --stdin zqj
WORKDIR /root
RUN wget http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
RUN rpm -Uvh zabbix-release-4.0-1.el7.noarch.rpm
RUN yum clean all&& yum repolist
RUN yum -y install epel-release
RUN yum -y install python-pip 
RUN yum -y install firefox tigervnc-server
RUN yum -y install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
RUN yum -y groupinstall Fonts
ADD syskafka.repo /etc/yum.repo.d/
RUN yum clean all && yum repolist
RUN yum install -y rsyslog rsyslog-kafka
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]






syskafka.repo
[rsyslog_v8]
name=Adiscon CentOS-$releasever - local packages for $basearch
baseurl=http://rpms.adiscon.com/v8-stable/epel-$releasever/$basearch
enabled=1
gpgcheck=0
gpgkey=http://rpms.adiscon.com/RPM-GPG-KEY-Adiscon
protect=1





docker network create --subnet 192.168.1.0/24 ansible

for i in {51..56};do docker run -d --ip 192.168.1.${i} --network ansible --name a${i} -h a${i} --privileged zqj:java init; done

 

发表评论

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