ARG ARCH FROM harbor.colben.cn/general/jdk$ARCH:8 MAINTAINER Colben colbenlee@gmail.com RUN tdnf makecache \ && tdnf -y install git openssh openssh-clients openssh-server sshpass jq ansible \ && echo 'root:Ops_1234' | chpasswd \ && mkdir -m 0700 /root/.ssh \ && sed -i \ -e '/^Port /d' \ -e '/^PermitRootLogin /d' \ -e '/^TCPKeepAlive /d' \ -e '/^ClientAliveInterval /d' \ -e '/^ClientAliveCountMax /d' \ -e '/^UseDNS /d' \ -e '$aPort 20022' \ -e '$aPermitRootLogin yes' \ -e '$aTCPKeepAlive yes' \ -e '$aClientAliveInterval 60' \ -e '$aClientAliveCountMax 3' \ -e '$aUseDNS yes' \ /etc/ssh/sshd_config \ && mkdir -m 0755 /etc/ansible \ && echo -e '[defaults]\n\ host_key_checking = False\n\ stdout_callback = debug\n\ retry_files_enabled = False\n\ ' > /etc/ansible/ansible.cfg \ && echo -e '[all:vars]\n\ ansible_ssh_port=22\n\ ansible_ssh_user=root\n\ ansible_ssh_pass=111111\n\ ' > /etc/ansible/hosts \ && grep '^export PS' /etc/bash.bashrc | sed 's/\\h/OPS/' >> /etc/profile \ && rm -rf /var/cache/tdnf ADD --chown=root:root /ADD/maven /opt/maven ADD --chown=root:root /ADD/ssh_host_* /etc/ssh/ ADD --chown=root:root /ADD/id_rsa* /root/.ssh/ ENV MAVEN_HOME=/opt/maven ENV PATH=${MAVEN_HOME}/bin:$PATH CMD ["/usr/sbin/sshd", "-D"]