12345678910111213141516171819 |
- FROM daocloud.io/library/ubuntu:18.10
- #sources.list添加阿里云镜像
- ADD sources.list /root/sources.list
- # RUN cp /root/sources.list /etc/apt/sources.list.d/aliyun.list
- RUN cp /root/sources.list /etc/apt/sources.list
- RUN apt-get update
- LABEL Name=github.com/jianboy/ubuntu-ssh Version=18.10
- #安装ssh
- RUN apt-get install -y openssh-server
- RUN mkdir -p /var/run/sshd
- #默认用户名密码 root:password
- RUN echo 'root:password' | chpasswd
- RUN sed -ri 's/^#PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
- RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
- EXPOSE 22
- CMD ["/usr/sbin/sshd", "-D"]
|