diff --git a/docker/gerrit/base/Dockerfile b/docker/gerrit/base/Dockerfile index 61dd2e229e..dedec7451e 100644 --- a/docker/gerrit/base/Dockerfile +++ b/docker/gerrit/base/Dockerfile @@ -20,17 +20,17 @@ FROM docker.io/opendevorg/python-builder:3.9-bullseye as builder COPY . /tmp/src RUN assemble -FROM docker.io/library/openjdk:11-bullseye as gerrit-base +FROM docker.io/opendevorg/python-base:3.9-bullseye 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 python3-launchpadlib python3-distutils unzip \ + && apt-get install -y dumb-init git openjdk-11-jre-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/* \ - && curl https://bootstrap.pypa.io/get-pip.py > /tmp/get-pip.py \ - && python3 /tmp/get-pip.py \ - && rm /tmp/get-pip.py + && rm -rf /var/lib/apt/lists/* COPY --from=builder /output/ /output RUN /output/install-from-bindep diff --git a/playbooks/roles/gerrit/templates/gerrit.config.j2 b/playbooks/roles/gerrit/templates/gerrit.config.j2 index 7b068096f2..cecf699485 100644 --- a/playbooks/roles/gerrit/templates/gerrit.config.j2 +++ b/playbooks/roles/gerrit/templates/gerrit.config.j2 @@ -35,7 +35,7 @@ {% if gerrit_heap_limit is defined %} heapLimit = {{ gerrit_heap_limit }} {% endif %} - javaHome = /usr/local/openjdk-11/jre + javaHome = /usr/lib/jvm/java-11-openjdk-amd64 javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance" javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance" [gc] diff --git a/playbooks/zuul/gerrit/files/run-gerrit.sh b/playbooks/zuul/gerrit/files/run-gerrit.sh index 753acfeb57..144b7fb006 100755 --- a/playbooks/zuul/gerrit/files/run-gerrit.sh +++ b/playbooks/zuul/gerrit/files/run-gerrit.sh @@ -1,4 +1,4 @@ #!/bin/sh # The /dev/./urandom is not a typo. https://stackoverflow.com/questions/58991966/what-java-security-egd-option-is-for -/usr/local/openjdk-11/bin/java -Djava.security.egd=file:/dev/./urandom ${JAVA_OPTIONS} -jar /var/gerrit/bin/gerrit.war daemon -d /var/gerrit +/usr/lib/jvm/java-11-openjdk-amd64/bin/java -Djava.security.egd=file:/dev/./urandom ${JAVA_OPTIONS} -jar /var/gerrit/bin/gerrit.war daemon -d /var/gerrit diff --git a/zuul.d/docker-images/gerrit.yaml b/zuul.d/docker-images/gerrit.yaml index 8a9f000e03..d4d949173c 100644 --- a/zuul.d/docker-images/gerrit.yaml +++ b/zuul.d/docker-images/gerrit.yaml @@ -6,7 +6,9 @@ required-projects: &gerrit_base_projects - opendev/jeepyb - opendev/system-config - requires: python-builder-3.9-bullseye-container-image + requires: + - python-builder-3.9-bullseye-container-image + - python-base-3.9-bullseye-container-image provides: gerrit-base-container-image pre-run: &gerrit-base_prerun - playbooks/zuul/gerrit/base.yaml @@ -24,7 +26,9 @@ name: system-config-upload-image-gerrit-base description: Build and upload a gerrit-base image. parent: system-config-upload-image - requires: python-builder-3.9-bullseye-container-image + requires: + - python-builder-3.9-bullseye-container-image + - python-base-3.9-bullseye-container-image provides: gerrit-base-container-image pre-run: *gerrit-base_prerun required-projects: *gerrit_base_projects