Tony Breeds 0eec8291b1 Update Gerrit images to 3.9.7 and 3.10.2
There are new bugfix updates for both of the Gerrit images we are building.
Bump up to these new releases. As far as I can tell all plugins with fixed
tags have just been retagged (for both v3.9.x and v3.10.x).

Change-Id: Ie57b11a48919bd3fb0f27beaf8d92a99397bb10a
2024-10-14 13:18:15 +11:00

81 lines
2.7 KiB
Docker

# Copyright (c) 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Mon, 14 Oct 2024 01:23:20 +0000 - trigger rebuild
FROM docker.io/opendevorg/python-builder:3.11-bookworm as builder
COPY . /tmp/src
RUN assemble
FROM docker.io/opendevorg/python-base:3.11-bookworm as gerrit-base
RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/95disable-recommends
RUN apt-get update \
&& apt-get install -y dumb-init git openssh-client openjdk-17-jdk-headless unzip \
# This next set of installs helps align us with the old openjdk image \
# but they may not all be necessary \
&& apt-get install -y xz-utils bzip2 wget curl gnupg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /output/ /output
RUN /output/install-from-bindep
# 3000 is what the existing opendev gerrit2 uid is
RUN addgroup gerrit --gid 3000 --system \
&& adduser \
--system \
--uid 3000 \
--home /var/gerrit \
--shell /bin/bash \
--ingroup gerrit \
gerrit
# Startup scripts
COPY wait-for-it.sh /wait-for-it.sh
RUN chmod +x /wait-for-it.sh
COPY run-gerrit.sh /run-gerrit.sh
RUN chmod +x /run-gerrit.sh
USER gerrit
RUN mkdir /var/gerrit/bin \
&& mkdir /var/gerrit/hooks \
&& mkdir /var/gerrit/static
# Download mariadb java client.
# Modern gerrit stopped downloading missing libs during init which means we
# need to do the downland and install ourselves.
# Note the perms on this are 0600 hence the need for the chown otherwise
# they are root owned and Gerrit can't use the jdbc driver.
ADD --chown=gerrit:gerrit https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.2/mariadb-java-client-2.7.2.jar /var/gerrit/lib/mariadb-java-client.jar
# Allow incoming traffic
# OpenDev Gerrit listens on 8081 not default of 8080
EXPOSE 29418 8081
VOLUME /var/gerrit/git /var/gerrit/index /var/gerrit/cache /var/gerrit/db /var/gerrit/etc /var/log/gerrit /var/gerrit/tmp /var/gerrit/data
RUN ln -s /var/log/gerrit /var/gerrit/logs
# container.javaOptions
# Also include container.heapLimit - but with -Xmx prefixing it
ENV JAVA_OPTIONS ""
# Ulimits should be set on command line or in docker-compose.yaml
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD "/run-gerrit.sh"