Skip to content

Commit

Permalink
[feature] multi arch for release
Browse files Browse the repository at this point in the history
set :release to develop-6.x.x branch
  • Loading branch information
duncdrum committed Nov 13, 2024
1 parent ee5a8d9 commit 855cb3d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
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'
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/develop-6.x.x' || github.base_ref == 'develop' || github.base_ref == 'develop-6.x.x'
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
run: mvn -q -Ddocker.tag=latest -Ddocker.username=$DOCKER_USERNAME -Ddocker.password=$DOCKER_PASSWORD docker:build docker:push
working-directory: ./exist-docker
- name: Publish release images
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/develop-6.x.x'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down
4 changes: 3 additions & 1 deletion exist-docker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,14 @@
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.40.3</version>
<version>0.45.1</version>
<configuration>
<verbose>true</verbose>
<pushRegistry>registry.hub.docker.com</pushRegistry>
<images>
<image>
<name>existdb/existdb:%v</name>
<registry>registry.hub.docker.com</registry>
<alias>exist</alias>
<build>
<buildx>
Expand All @@ -243,6 +244,7 @@
</image>
<image>
<name>existdb/existdb:%v-DEBUG</name>
<registry>registry.hub.docker.com</registry>
<alias>exist-debug</alias>
<build>
<buildx>
Expand Down
40 changes: 14 additions & 26 deletions exist-docker/src/main/resources-filtered/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,20 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#

# Install latest JRE 8 in Debian Stretch (which is the base of gcr.io/distroless/java:8)
FROM debian:stretch-slim as updated-jre
RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
RUN echo "deb http://archive.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
RUN apt-get update && apt-get -y dist-upgrade
RUN apt-get install -y openjdk-8-jre-headless
RUN apt-get install -y expat fontconfig # Install tools required by FOP
# Install latest JRE 8 in Debian bookworm (which is the base of gcr.io/distroless/java)
FROM maven:3-eclipse-temurin-8 as updated-jre

FROM gcr.io/distroless/java:8
# RUN apt-get update && apt-get -y dist-upgrade
# RUN apt install -y wget apt-transport-https gpg
# RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null
# RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
# RUN apt-get update && apt-get install -y temurin-8-jre

# Copy over updated JRE from Debian Stretch
COPY --from=updated-jre /etc/java-8-openjdk /etc/java-8-openjdk
COPY --from=updated-jre /usr/lib/jvm/java-8-openjdk-amd64 /usr/lib/jvm/java-8-openjdk-amd64
COPY --from=updated-jre /usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64 /usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64
FROM gcr.io/distroless/java-base-debian12:latest

# Copy over dependencies for Apache FOP, missing from GCR's JRE
COPY --from=updated-jre /usr/lib/x86_64-linux-gnu/libfreetype.so.6 /usr/lib/x86_64-linux-gnu/libfreetype.so.6
COPY --from=updated-jre /usr/lib/x86_64-linux-gnu/liblcms2.so.2 /usr/lib/x86_64-linux-gnu/liblcms2.so.2
COPY --from=updated-jre /usr/lib/x86_64-linux-gnu/libpng16.so.16 /usr/lib/x86_64-linux-gnu/libpng16.so.16
COPY --from=updated-jre /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=updated-jre /etc/fonts /etc/fonts
COPY --from=updated-jre /lib/x86_64-linux-gnu/libexpat.so.1 /lib/x86_64-linux-gnu/libexpat.so.1
COPY --from=updated-jre /usr/share/fontconfig /usr/share/fontconfig
COPY --from=updated-jre /usr/share/fonts/truetype/dejavu /usr/share/fonts/truetype/dejavu
ENV JAVA_HOME=/opt/java/openjdk
COPY --from=updated-jre $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"

# Copy eXist-db
COPY LICENSE /exist/LICENSE
Expand Down Expand Up @@ -73,10 +61,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 \
Expand All @@ -91,7 +79,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", \
Expand Down
19 changes: 10 additions & 9 deletions exist-docker/src/main/resources-filtered/Dockerfile-DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#

# Use JDK 8 in Debian Stretch (as our production image gcr.io/distroless/java:8 is based on Debian Stretch with just a JRE)
FROM debian:stretch-slim
RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
RUN echo "deb http://archive.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
# Use JDK 8 in Debian bookworm (as our production image gcr.io/distroless/ is based on Debian 12 with just a JRE)
FROM debian:bookworm-slim as updated-jre

RUN apt-get update && apt-get -y dist-upgrade
RUN apt-get install -y openjdk-8-jdk-headless
RUN apt-get install -y expat fontconfig # Install tools required by FOP
RUN apt install -y wget apt-transport-https gpg
RUN wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null
RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
RUN apt-get update && apt-get install -y temurin-8-jdk

# Copy eXist-db
COPY LICENSE /exist/LICENSE
Expand Down Expand Up @@ -54,10 +55,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 \
Expand All @@ -73,7 +74,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", \
Expand Down

0 comments on commit 855cb3d

Please sign in to comment.