FROM phusion/baseimage:0.9.22
RUN rm -f /etc/service/sshd/down
# Use baseimage-docker's init system.CMD ["/sbin/my_init"]
# ...put your own build instructions here...
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"
EXPOSE 22
## Install an SSH of your choice.COPY id_rsa.pub /tmp/id_rsa.pubRUN cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys && rm -f /tmp/id_rsa.pub
# Clean up APT when done.RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
docker run -t -i -p 22:2222 phusion_ssh /sbin/my_init -- bash -l
FDZ452:ubuntu-docker brian.phillips$ ssh -vvv ro...@172.17.0.2 -p 22OpenSSH_7.2p2, LibreSSL 2.4.1debug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 20: Applying options for *debug2: resolving "172.17.0.2" port 22debug2: ssh_connect_direct: needpriv 0debug1: Connecting to 172.17.0.2 [172.17.0.2] port 22.debug1: connect to address 172.17.0.2 port 22: Operation timed outssh: connect to host 172.17.0.2 port 22: Operation timed out
FDZ452:ubuntu-docker brian.phillips$ ssh -vvv ro...@0.0.0.0 -p 2222OpenSSH_7.2p2, LibreSSL 2.4.1debug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 20: Applying options for *debug2: resolving "0.0.0.0" port 2222debug2: ssh_connect_direct: needpriv 0debug1: Connecting to 0.0.0.0 [0.0.0.0] port 2222.debug1: connect to address 0.0.0.0 port 2222: Connection refusedssh: connect to host 0.0.0.0 port 2222: Connection refused