Created
February 16, 2016 15:34
-
-
Save greyhoundforty/fe86871b72afe283f0d7 to your computer and use it in GitHub Desktop.
Dockefile 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
# Use phusion/baseimage as base image. To make your builds reproducible, make | |
# sure you lock down to a specific version, not to `latest`! | |
# See https://github.com/phusion/baseimage-docker/blob/master/Changelog.md for | |
# a list of version numbers. | |
FROM phusion/baseimage:0.9.18 | |
# Use baseimage-docker's init system. | |
CMD ["/sbin/my_init"] | |
# ...put your own build instructions here... | |
RUN rm -f /etc/service/sshd/down | |
# Regenerate SSH host keys. baseimage-docker does not contain any, so you | |
# have to do that yourself. You may also comment out this instruction; the | |
# init system will auto-generate one during boot. | |
RUN /etc/my_init.d/00_regen_ssh_host_keys.sh | |
ADD $HOME/.ssh/id_rsa.pub | |
RUN cat /tmp/your_key.pub >> /root/.ssh/authorized_keys && rm -f /tmp/your_key.pub | |
# Clean up APT when done. | |
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment