ARG BASE_IMAGE=alpine:latest FROM ${BASE_IMAGE} RUN apk add --no-cache openssh-server fish git sudo tini # default uid for git user who has access to all repos ENV GIT_UID=1000 ENV GIT_GID=1000 # Modified ssh conf with disabled root login and no password authentication COPY src/ssh.conf /etc/ssh/sshd_config.d/ COPY src/sudo-git /etc/sudoers.d/ # copy scrips COPY src/env /usr/local/bin/ COPY src/init /usr/local/bin/ COPY src/git-run /usr/local/bin/ RUN chmod 755 /usr/local/bin/env RUN chmod 755 /usr/local/bin/init RUN chmod 755 /usr/local/bin/git-run COPY src/version /usr/local/bin/ COPY src/banner /usr/local/bin/ # we need a init that reaps zombies # setups users and starts sshd daemon ENTRYPOINT ["tini", "--", "/usr/local/bin/init"] CMD [] ARG APP_VERSION # license information LABEL org.opencontainers.image.licenses="GPL-3.0-or-later" LABEL org.opencontainers.image.authors="Matthias Jaros" LABEL org.opencontainers.image.version="${APP_VERSION}" LABEL org.opencontainers.image.source="https://github.com/jarlucmat/gitfish" LABEL org.opencontainers.image.url="https://github.com/jarlucmat/gitfish" LABEL org.opencontainers.image.title="gitfish" LABEL org.opencontainers.image.description="A minimal, secure Git server using SSH and Fish." LABEL org.opencontainers.image.documentation="/usr/share/doc/gitfish/LICENSE" COPY LICENSE /usr/share/doc/gitfish/LICENSE