本文共 749 字,大约阅读时间需要 2 分钟。
FROM centos:latest
MAINTAINER from jason@a.comRUN yum install -y -q httpd openssh-server sudo net-tools iprouteRUN useradd adminRUN echo "admin:admin" | chpasswdRUN echo "admin ALL=(ALL) ALL" >> /etc/sudoersRUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_keyRUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_keyRUN ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_keyRUN ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_keyRUN mkdir -p /var/run/sshdRUN mkdir -p /home/admin/.sshRUN sed -ri 's/#ServerName www.example.com:80/ServerName www.cloud.com/g' /etc/httpd/conf/httpd.confADD authorized_keys /home/admin/.ssh/authorized_keysADD run.sh /run.shRUN chmod 775 /run.shEXPOSE 22 80CMD ["/run.sh"]转载于:https://blog.51cto.com/jxwpx/2358233