Created
February 10, 2017 19:13
-
-
Save jeffbrl/05fb5f98e773a6f2336ec416113f865e to your computer and use it in GitHub Desktop.
Dockerfile for ssh container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on Duke Dougal's post at http://superuser.com/questions/844101/docker-login-via-ssh-always-asks-for-password | |
FROM ubuntu:trusty | |
ENV USER ubuntu | |
RUN apt-get update && apt-get install -y openssh-server | |
RUN mkdir /var/run/sshd | |
RUN adduser --disabled-password --gecos "" $USER | |
RUN adduser $USER sudo | |
ADD authorized_keys /home/$USER/.ssh/authorized_keys | |
RUN chown $USER /home/$USER/.ssh/authorized_keys | |
RUN chown -R $USER:$USER /home/$USER/.ssh/authorized_keys | |
RUN chmod 700 /home/$USER/.ssh/authorized_keys | |
EXPOSE 22 | |
CMD ["/usr/sbin/sshd", "-D"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment