docker-gitolite/Dockerfile

28 lines
721 B
Text
Raw Permalink Normal View History

FROM docker.io/library/alpine:3.21
2016-02-24 10:24:26 +01:00
2016-02-24 14:12:54 +01:00
# Install OpenSSH server and Gitolite
# Unlock the automatically-created git user
2016-02-24 10:24:26 +01:00
RUN set -x \
2017-11-22 15:21:35 +01:00
&& apk add --no-cache gitolite openssh \
2016-02-24 10:24:26 +01:00
&& passwd -u git
COPY gitconfig /etc/gitconfig
COPY sshd_config /etc/ssh/sshd_config
2016-02-24 14:12:54 +01:00
# Volume used to store SSH host keys, generated on first run
2016-02-24 10:24:26 +01:00
VOLUME /etc/ssh/keys
2016-02-24 14:12:54 +01:00
# Volume used to store all Gitolite data (keys, config and repositories), initialized on first run
2016-02-24 10:24:26 +01:00
VOLUME /var/lib/git
2016-02-24 14:12:54 +01:00
# Entrypoint responsible for SSH host keys generation, and Gitolite data initialization
2016-02-24 10:24:26 +01:00
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
# Expose port 2222 to access SSH
EXPOSE 2222
2016-02-24 10:24:26 +01:00
2016-02-24 14:12:54 +01:00
# Default command is to run the SSH server
2016-02-24 10:24:26 +01:00
CMD ["sshd"]