diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml index 94b1ee46c48..a81af4f361c 100644 --- a/.github/workflows/ci-deploy.yml +++ b/.github/workflows/ci-deploy.yml @@ -5,6 +5,7 @@ jobs: name: Build and Test Images runs-on: ubuntu-latest # NOTE (DP): Publish on develop and master, test on PRs against these + # TODO(DP) Reinstate CRONed release builds to update stock apps regularly if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' || github.base_ref == 'develop' || github.base_ref == 'master' steps: - uses: actions/checkout@v4 @@ -15,6 +16,10 @@ jobs: with: distribution: liberica java-version: '17' + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: linux/amd64,linux/arm64 - name: Make buildkit default uses: docker/setup-buildx-action@v3 id: buildx @@ -27,7 +32,11 @@ jobs: key: deploy-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: deploy-${{ runner.os }}-maven - name: Install bats - run: sudo apt-get install bats + run: sudo apt-get install bats + # Hack around #5450 + - name: pull base image + run: | + docker pull --platform linux/amd64 --platform linux/arm64 gcr.io/distroless/java17-debian12:latest - name: Build images run: mvn -V -B -q -Pdocker -DskipTests -Ddependency-check.skip=true -P !mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives clean package - name: Check local images diff --git a/exist-docker/pom.xml b/exist-docker/pom.xml index 13c9c1a4dd6..eb89bb1d1a5 100644 --- a/exist-docker/pom.xml +++ b/exist-docker/pom.xml @@ -22,7 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --> - + 4.0.0 @@ -42,14 +44,15 @@ scm:git:https://github.com/exist-db/exist.git scm:git:https://github.com/exist-db/exist.git scm:git:https://github.com/exist-db/exist.git - HEAD - + HEAD + ${project.build.directory}/exist-docker-${project.version}-docker-dir exist.uber.jar latest debug + linux/amd64, linux/arm64 @@ -106,7 +109,9 @@ true - ${project.groupId}:exist-distribution:pom:${project.version} + + ${project.groupId}:exist-distribution:pom:${project.version} @@ -124,7 +129,8 @@ single - ${project.basedir}/../exist-distribution/target/exist-distribution-${project.version}-dir + + ${project.basedir}/../exist-distribution/target/exist-distribution-${project.version}-dir false src/assembly/dist-assembly-docker.xml @@ -183,18 +189,24 @@ - - + + false - + META-INF/mailcap - + META-INF/mailcap.default - - + + true @@ -210,12 +222,19 @@ docker-maven-plugin 0.45.1 - true + true + registry.hub.docker.com existdb/existdb:%v + registry.hub.docker.com exist + + + ${docker.platforms} + + ${docker.tag} @@ -225,8 +244,14 @@ existdb/existdb:%v-DEBUG + registry.hub.docker.com exist-debug + + + ${docker.platforms} + + ${docker.debug.tag} @@ -256,4 +281,4 @@ - + \ No newline at end of file diff --git a/exist-docker/src/main/resources-filtered/Dockerfile b/exist-docker/src/main/resources-filtered/Dockerfile index 16887291004..72cbcda71eb 100644 --- a/exist-docker/src/main/resources-filtered/Dockerfile +++ b/exist-docker/src/main/resources-filtered/Dockerfile @@ -20,25 +20,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # -# Use Debian Bullseye (which is the base of gcr.io/distroless/java:17) for additional library dependencies that we need -# FROM debian:bullseye-slim as debian-slim -# RUN apt-get update && apt-get -y dist-upgrade -# RUN apt-get install -y openjdk-17-jre-headless -# RUN apt-get install -y expat fontconfig # Install tools required by FOP - -FROM gcr.io/distroless/java17:latest - -# Copy over dependencies for Apache FOP, missing from GCR's JRE -# COPY --from=debian-slim /usr/lib/x86_64-linux-gnu/libfreetype.so.6 /usr/lib/x86_64-linux-gnu/libfreetype.so.6 -# COPY --from=debian-slim /usr/lib/x86_64-linux-gnu/liblcms2.so.2 /usr/lib/x86_64-linux-gnu/liblcms2.so.2 -# COPY --from=debian-slim /usr/lib/x86_64-linux-gnu/libpng16.so.16 /usr/lib/x86_64-linux-gnu/libpng16.so.16 -# COPY --from=debian-slim /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 - -# Copy dependencies for Apache Batik (used by Apache FOP to handle SVG rendering) -# COPY --from=debian-slim /etc/fonts /etc/fonts -# COPY --from=debian-slim /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1 -# COPY --from=debian-slim /usr/share/fontconfig /usr/share/fontconfig -# COPY --from=debian-slim /usr/share/fonts/truetype/dejavu /usr/share/fonts/truetype/dejavu +FROM gcr.io/distroless/java17-debian12:latest # Copy eXist-db COPY LICENSE /exist/LICENSE @@ -66,10 +48,10 @@ ARG CACHE_MEM ARG MAX_BROKER ARG JVM_MAX_RAM_PERCENTAGE -ENV EXIST_HOME "/exist" +ENV EXIST_HOME=/exist ENV CLASSPATH=/exist/lib/${exist.uber.jar.filename} -ENV JAVA_TOOL_OPTIONS \ +ENV JAVA_TOOL_OPTIONS="\ -Dfile.encoding=UTF8 \ -Dsun.jnu.encoding=UTF-8 \ -Djava.awt.headless=true \ @@ -85,7 +67,7 @@ ENV JAVA_TOOL_OPTIONS \ -XX:+UseStringDeduplication \ -XX:+UseContainerSupport \ -XX:MaxRAMPercentage=${JVM_MAX_RAM_PERCENTAGE:-75.0} \ - -XX:+ExitOnOutOfMemoryError + -XX:+ExitOnOutOfMemoryError" HEALTHCHECK CMD [ "java", \ "org.exist.start.Main", "client", \ diff --git a/exist-docker/src/main/resources-filtered/Dockerfile-DEBUG b/exist-docker/src/main/resources-filtered/Dockerfile-DEBUG index 17bf0239765..44324782875 100644 --- a/exist-docker/src/main/resources-filtered/Dockerfile-DEBUG +++ b/exist-docker/src/main/resources-filtered/Dockerfile-DEBUG @@ -21,7 +21,7 @@ # # Use JDK 17 in Debian Bullseye (as our production image gcr.io/distroless/java:17 is based on Debian Bullseye with just a JRE) -FROM debian:bullseye-slim +FROM debian:bookworm-slim RUN apt-get update && apt-get -y dist-upgrade RUN apt-get install -y openjdk-17-jdk-headless RUN apt-get install -y expat fontconfig # Install tools required by FOP @@ -52,10 +52,10 @@ ARG MAX_BROKER ARG JVM_MAX_RAM_PERCENTAGE ARG JVM_JDWP_SUSPEND -ENV EXIST_HOME "/exist" +ENV EXIST_HOME=/exist ENV CLASSPATH=/exist/lib/${exist.uber.jar.filename} -ENV JAVA_TOOL_OPTIONS \ +ENV JAVA_TOOL_OPTIONS="\ -Dfile.encoding=UTF8 \ -Dsun.jnu.encoding=UTF-8 \ -Djava.awt.headless=true \ @@ -72,7 +72,7 @@ ENV JAVA_TOOL_OPTIONS \ -XX:+UseContainerSupport \ -XX:MaxRAMPercentage=${JVM_MAX_RAM_PERCENTAGE:-75.0} \ -XX:+ExitOnOutOfMemoryError \ - -agentlib:jdwp=transport=dt_socket,server=y,suspend=${JVM_JDWP_SUSPEND:-n},address=5005 + -agentlib:jdwp=transport=dt_socket,server=y,suspend=${JVM_JDWP_SUSPEND:-n},address=5005" HEALTHCHECK CMD [ "java", \ "org.exist.start.Main", "client", \