Skip to content

Instantly share code, notes, and snippets.

@skahack
Last active August 14, 2017 17:33
Show Gist options
  • Save skahack/6277480 to your computer and use it in GitHub Desktop.
Save skahack/6277480 to your computer and use it in GitHub Desktop.
FROM ubuntu:12.04
MAINTAINER SKAhack
run echo "deb http://archive.ubuntu.com/ubuntu quantal main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-get install -y openssh-server
RUN apt-get install -y sudo
RUN mkdir -p /home/docker
RUN useradd docker
RUN echo "docker:docker" | chpasswd
RUN mkdir -p /home/docker/.ssh; chown docker /home/docker/.ssh; chmod 700 /home/docker/.ssh
ADD ./authorized_keys /home/docker/.ssh/
ADD ./authorized_keys /root/.ssh/
RUN echo "docker ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN mkdir /var/run/sshd
RUN /usr/sbin/sshd
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