FROM debian:stretch-slim RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ openssh-server \ && apt-get clean RUN mkdir /var/run/sshd RUN echo 'root:YourRootPasswordHere' | chpasswd RUN useradd -m --shell /bin/bash user RUN echo 'user:YourUserPasswordHere' | chpasswd EXPOSE 22 CMD ["/usr/sbin/sshd","-D"]
Build it: docker build --tag=debian .
Start it: docker run -h debian -d -p 222:22 --name=debian debian
Console locally: docker exec -ti debian /bin/bash
Remote Console: Connect via SSH at Port 222
Size of the image: ~150MB
Debian-slim doesn't have vi or nano installed.