Created
October 8, 2021 08:13
-
-
Save mdrokz/76bb08ea3adfe10220efee7c6af8ae2c to your computer and use it in GitHub Desktop.
Dockerfile for building alpine container that has sshd enabled
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
FROM alpine:latest | |
RUN apk add -U openssh sudo wireguard-tools | |
RUN echo -e "Port 2222\n" >> /etc/ssh/sshd_config | |
RUN echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel | |
RUN adduser --disabled-password test wheel | |
RUN echo 'test ALL=(ALL) ALL' >> /etc/sudoers | |
RUN echo 'test:admin@123' | chpasswd | |
RUN cd /etc/ssh && ssh-keygen -A | |
EXPOSE 2222 | |
CMD ["/usr/sbin/sshd", "-e", "-D"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment