最近实验室的学弟学妹们要展示自己的静态网站作业,想着自己阿里云上还有一台服务器,就准备用docke 给他们做一个展示。参考了一部分dockerfile但是仍然不太好
列出Dockerfile
FROM alpine:latest
MAINTAINER becivells <becivells@gmail.com>
RUN apk add --update openssh
RUN apk add nginx
RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
RUN sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config && sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config && sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config && sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config
EXPOSE 80
EXPOSE 22
CMD ["nginx", "-g", "daemon off;"]
CMD ["/usr/sbin/sshd"