Dockerfile (1412B)
1 ARG BASE_IMAGE=alpine:latest 2 3 FROM ${BASE_IMAGE} 4 5 RUN apk update && apk upgrade && apk add --no-cache openssh-server fish git sudo tini 6 7 # default uid for git user who has access to all repos 8 ENV GIT_UID=1000 9 ENV GIT_GID=1000 10 11 # Modified ssh conf with disabled root login and no password authentication 12 COPY src/ssh.conf /etc/ssh/sshd_config.d/ 13 COPY src/sudo-git /etc/sudoers.d/ 14 15 # copy scrips 16 COPY src/env /usr/local/bin/ 17 COPY src/init /usr/local/bin/ 18 COPY src/git-run /usr/local/bin/ 19 RUN chmod 755 /usr/local/bin/env 20 RUN chmod 755 /usr/local/bin/init 21 RUN chmod 755 /usr/local/bin/git-run 22 23 COPY src/version /usr/local/bin/ 24 COPY src/banner /usr/local/bin/ 25 26 # we need a init that reaps zombies 27 # setups users and starts sshd daemon 28 ENTRYPOINT ["tini", "--", "/usr/local/bin/init"] 29 CMD [] 30 31 ARG APP_VERSION 32 33 # license information 34 LABEL org.opencontainers.image.licenses="GPL-3.0-or-later" 35 LABEL org.opencontainers.image.authors="Matthias Jaros" 36 LABEL org.opencontainers.image.version="${APP_VERSION}" 37 LABEL org.opencontainers.image.source="https://github.com/jarlucmat/gitreef" 38 LABEL org.opencontainers.image.url="https://github.com/jarlucmat/gitreef" 39 LABEL org.opencontainers.image.title="gitreef" 40 LABEL org.opencontainers.image.description="A minimal, secure Git server using SSH and Fish." 41 LABEL org.opencontainers.image.documentation="/usr/share/doc/gitreef/LICENSE" 42 COPY LICENSE /usr/share/doc/gitreef/LICENSE