-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (43 loc) · 1.78 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM adoptopenjdk/openjdk11:alpine-jre
LABEL maintainer="SupportEPMD-EDP@epam.com"
# Overridable defaults
ENV GERRIT_HOME /var/gerrit
ENV GERRIT_SITE ${GERRIT_HOME}/review_site
ENV GERRIT_WAR ${GERRIT_HOME}/gerrit.war
ENV GERRIT_VERSION 3.7.9
ENV GERRIT_USER gerrit2
ENV GERRIT_INIT_ARGS "--install-all-plugins"
# Add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN adduser -D -h "${GERRIT_HOME}" -g "Gerrit User" -s /sbin/nologin "${GERRIT_USER}"
RUN set -x \
&& apk add --update --no-cache \
bash=5.1.16-r0 \
curl=8.0.1-r0 \
git-gitweb=2.32.7-r0 \
git=2.32.7-r0 \
openssh-client=8.6_p1-r3 \
openssl=1.1.1t-r2 \
perl-cgi=4.51-r0 \
perl=5.32.1-r0 \
su-exec=0.2-r1
RUN mkdir /docker-entrypoint-init.d && \
curl -fSsL https://gerrit-releases.storage.googleapis.com/gerrit-${GERRIT_VERSION}.war -o ${GERRIT_WAR}
#Download Plugins
ENV PLUGIN_VERSION=3.7
ENV GERRITFORGE_URL=https://gerrit-ci.gerritforge.com
ENV GERRITFORGE_ARTIFACT_DIR=lastSuccessfulBuild/artifact/bazel-bin/plugins
RUN for plugin in events-log oauth metrics-reporter-prometheus; do \
curl -fSsL "${GERRITFORGE_URL}/job/plugin-${plugin}-bazel-master-stable-${PLUGIN_VERSION}/${GERRITFORGE_ARTIFACT_DIR}/${plugin}/${plugin}.jar" \
-o "${GERRIT_HOME}/${plugin}.jar"; \
done
# Ensure the entrypoint scripts are in a fixed location
COPY gerrit-entrypoint.sh /
COPY gerrit-start.sh /
RUN chmod +x /gerrit*.sh && \
su-exec ${GERRIT_USER} mkdir -p $GERRIT_SITE
#Gerrit site directory is a volume, so configuration and repositories
#can be persisted and survive image upgrades.
VOLUME $GERRIT_SITE
ENTRYPOINT ["/gerrit-entrypoint.sh"]
EXPOSE 8080 29418
CMD ["/gerrit-start.sh"]