FROM alpine RUN apk add --update git openssh \ && rm -rf /tmp/* /var/cache/apk/* RUN ssh-keygen -A # creates locked password RUN adduser -D -u 500 ist # unlock and disable password RUN passwd -ud ist RUN echo "PasswordAuthentication no" >> /etc/ssh/sshd_config EXPOSE 22 # mount server .ssh/authorized keys as volume in start command CMD ["/usr/sbin/sshd","-D"]