# Instruction for Dockerfile to create a new image on top of the base image (nvidia/cuda:11.0-base) FROM alpine:latest RUN apk add --update --no-cache openssh RUN mkdir /var/run/sshd RUN echo "root:root" | chpasswd RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config RUN echo 'ListenAddress 0.0.0.0' >> /etc/ssh/sshd_config RUN echo 'Port 7860' >> /etc/ssh/sshd_config RUN echo 'PidFile /home/user/ssh.pid' >> /etc/ssh/sshd_config RUN echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config RUN echo 'AllowTcpForwarding yes' >> /etc/ssh/sshd_config RUN echo 'PermitTunnel yes' >> /etc/ssh/sshd_config RUN echo 'GatewayPorts yes' >> /etc/ssh/sshd_config RUN adduser -h /home/user -s /bin/sh -D user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH EXPOSE 7860 CMD ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519 && \ /usr/sbin/sshd -h $HOME/.ssh/id_ed25519 -D -e "$@"