Expose volume for tmp dir, add dirs for hooks and static

Our existing config management puts files into hooks and static.
We can bind mount those in, but having the mount-points in the
image is useful.

The tmp dir is important for gerrit to be able to write
plugin expansions and javaamelody data.

Change-Id: Idd917c268ed7bdead412620dfe3ca842736b7463
This commit is contained in:
Monty Taylor 2019-08-27 13:19:18 +02:00
parent d2e7da959d
commit 5a31c91623
2 changed files with 9 additions and 5 deletions

View File

@ -34,8 +34,10 @@ RUN addgroup gerrit --gid 3000 --system \
USER gerrit USER gerrit
# Download the gerrit war # Download the gerrit war
RUN mkdir /var/gerrit/bin && \ RUN mkdir /var/gerrit/bin \
wget https://tarballs.openstack.org/gerrit/gerrit-v2.13.12.11.1707fec.war -O /var/gerrit/bin/gerrit.war && mkdir /var/gerrit/hooks \
&& mkdir /var/gerrit/static \
&& wget https://tarballs.openstack.org/gerrit/gerrit-v2.13.12.11.1707fec.war -O /var/gerrit/bin/gerrit.war
# Install plugins # Install plugins
RUN mkdir /var/gerrit/plugins && \ RUN mkdir /var/gerrit/plugins && \
@ -53,7 +55,7 @@ RUN mkdir /var/gerrit/lib && \
# Allow incoming traffic # Allow incoming traffic
EXPOSE 29418 8080 EXPOSE 29418 8080
VOLUME /var/gerrit/git /var/gerrit/index /var/gerrit/cache /var/gerrit/db /var/gerrit/etc /var/log/gerrit VOLUME /var/gerrit/git /var/gerrit/index /var/gerrit/cache /var/gerrit/db /var/gerrit/etc /var/log/gerrit /var/gerrit/tmp
RUN ln -s /var/log/gerrit /var/gerrit/logs RUN ln -s /var/log/gerrit /var/gerrit/logs

View File

@ -42,12 +42,14 @@ RUN addgroup gerrit --gid 3000 --system \
gerrit gerrit
USER gerrit USER gerrit
RUN mkdir /var/gerrit/bin RUN mkdir /var/gerrit/bin \
&& mkdir /var/gerrit/hooks \
&& mkdir /var/gerrit/static
# Allow incoming traffic # Allow incoming traffic
EXPOSE 29418 8080 EXPOSE 29418 8080
VOLUME /var/gerrit/git /var/gerrit/index /var/gerrit/cache /var/gerrit/db /var/gerrit/etc /var/log/gerrit VOLUME /var/gerrit/git /var/gerrit/index /var/gerrit/cache /var/gerrit/db /var/gerrit/etc /var/log/gerrit /var/gerrit/tmp
RUN ln -s /var/log/gerrit /var/gerrit/logs RUN ln -s /var/log/gerrit /var/gerrit/logs