aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorLibravatarLarge Libravatar Grégory Joubès <gregoryjoubesnetcourriercom>2020-11-04 12:59:58 +0100
committerLibravatarLarge Libravatar Grégory Joubès <gregoryjoubesnetcourriercom>2020-11-04 12:59:58 +0100
commita912704a1fdc06622466c9887051e1e0b2f5d42f (patch)
treea978007e14ff94454ac75356976a5863b6c79588 /Dockerfile
parent860fb6c4c8b1111a411e2587f394f2a9e8128716 (diff)
downloadcgit-oci-a912704a1fdc06622466c9887051e1e0b2f5d42f.tar.gz
cgit-oci-a912704a1fdc06622466c9887051e1e0b2f5d42f.tar.bz2
cgit-oci-a912704a1fdc06622466c9887051e1e0b2f5d42f.tar.lz
cgit-oci-a912704a1fdc06622466c9887051e1e0b2f5d42f.zip

Add a volume to manage SSH server keys. Add some clean up to reduce image size.

Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile52
1 files changed, 28 insertions, 24 deletions
diff --git a/Dockerfile b/Dockerfile
index 22a3210..f49018e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -6,33 +6,34 @@ WORKDIR /root
ARG HTTP_PROXY
-# Packages
-RUN apk update && apk add git openssh
-RUN apk add gcc make libressl-dev
-RUN apk add python3 py3-pygments
-RUN apk add py3-markdown
-RUN apk add linux-headers
-RUN ln -sf /usr/include/linux/unistd.h /usr/include/
-RUN apk add musl-dev
-RUN apk add libintl musl-libintl
-RUN apk add zlib zlib-dev
-# to support untar tar.xz
-RUN apk add tar
-# Vim is cool
-RUN apk add vim
+WORKDIR /root
-# Clean up
-RUN rm -rf /tmp/* /var/cache/apk/*
+# Packages we'll keep
+RUN apk update && apk add git openssh && \
+ apk add python3 py3-pygments && \
+ apk add py3-markdown && \
+ apk add libintl musl-libintl && \
+ apk add zlib
# cgit install
-WORKDIR /root
RUN git clone git://git.zx2c4.com/cgit
WORKDIR cgit
-RUN git submodule init
-RUN git submodule update
-RUN make install NO_LUA=1 NO_REGEX=NeedsStartEnd
-WORKDIR ../
-RUN rm -Rf cgit
+# Packages needed for build
+RUN apk update && apk add gcc make libressl-dev && \
+ apk add linux-headers && \
+ ln -sf /usr/include/linux/unistd.h /usr/include/ && \
+ apk add musl-dev zlib-dev && \
+# Build
+ git submodule init && \
+ git submodule update && \
+ make install NO_LUA=1 NO_REGEX=NeedsStartEnd && \
+# Clean up
+ cd ../ && \
+ rm -Rf cgit && \
+ apk del gcc make libressl-dev && \
+ apk del linux-headers musl-dev zlib-dev && \
+ rm -rf /tmp/* /var/cache/apk/*
+WORKDIR /root
# cgit config
ENV HTTP_AUTH_USER="", HTTP_AUTH_PASSWORD=""
@@ -44,8 +45,8 @@ RUN ln -s /home/git/cgitrc /etc/cgitrc
# Gitolite install
# Clone
-RUN git clone https://github.com/sitaramc/gitolite
-RUN gitolite/install -to /usr/local/bin/
+RUN git clone https://github.com/sitaramc/gitolite && \
+ gitolite/install -to /usr/local/bin/
# Default work dir for base image httpd
WORKDIR /usr/local/apache2
@@ -65,6 +66,9 @@ RUN adduser -D -g "" -s "/bin/ash" git
# We need a password set, otherwise pubkey auth doesn't work... why ?? /sbin/nologin doesn't work either
RUN echo "git:fhzefGG65gdoejdK$!dhd753" | chpasswd
+# Volume for server key
+VOLUME ["/etc/ssh"]
+
# Volume for /home/git
VOLUME ["/home/git"]