Created
December 11, 2013 21:21
-
-
Save matachi/7918664 to your computer and use it in GitHub Desktop.
Install sshd and automatically start it when starting a container. For example: `sudo docker build -t test . && sudo docker run -t -i -p 1337:22 test`
This file contains hidden or 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
FROM ubuntu | |
RUN apt-get update | |
RUN apt-get install -y openssh-server | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:pass' | chpasswd | |
CMD /usr/sbin/sshd && bash |
depending on the version of openssh, you'll typically receive an error saying that the run directory /run/sshd doesn't exist
when trying to call /usr/sbin/sshd
. This error can simply be resolved by making that directory
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can you tell me what RUN mkdir /var/run/sshd is for ?