Created
September 13, 2024 15:42
-
-
Save chancez/c2fd93e3fad59b78f5e7b2cba9b1d23c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 debian:12-slim | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN adduser git --home /srv/git && \ | |
chown -R git:git /srv/git | |
RUN apt-get update && \ | |
apt-get install --yes --no-install-recommends --no-install-suggests git openssh-server && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
sed -i 's/#AuthorizedKeysFile.*/AuthorizedKeysFile \/etc\/ssh\/keys\/%u\/authorized_keys/' /etc/ssh/sshd_config && \ | |
mkdir /run/sshd | |
ADD id_ed25519.pub /etc/ssh/keys/git/authorized_keys | |
ADD ssh_host_* /etc/ssh | |
EXPOSE 22 | |
VOLUME ["/srv/git"] | |
CMD ["/usr/sbin/sshd", "-D", "-e"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment