Skip to content

Commit

Permalink
Added ARM image
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Aug 7, 2024
1 parent c41e2a5 commit 7a87cb0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 15 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
build:

runs-on: ubuntu-latest

permissions:
contents: read
packages: write
Expand All @@ -22,22 +23,38 @@ jobs:
id-token: write

steps:
- name: Checkout repository
- name: Checkout Repository
uses: actions/checkout@v4

- name: Maven Configure
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Maven Build
run: set -x && mvn -v && mvn clean package -Dglassfish.version=$IMAGE_VERSION && docker image tag glassfish:$IMAGE_VERSION $IMAGE_ID:$IMAGE_VERSION && docker image tag glassfish:$IMAGE_VERSION $IMAGE_ID:latest && docker images | sort

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
platforms: linux/amd64,linux/arm64

- name: Build
run: mvn clean prepare-package -Dglassfish.version=$IMAGE_VERSION

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Docker Push

- name: Build Multirelease
uses: docker/build-push-action@v6
with:
context: ${{ env.IMAGE_VERSION }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.IMAGE_ID }}:${{ env.IMAGE_VERSION }},${{ env.IMAGE_ID }}:latest

- name: Additional Info
run: |
docker push $IMAGE_ID:$IMAGE_VERSION
docker push $IMAGE_ID:latest
mvn -v
uname -a
docker buildx ls
docker buildx imagetools inspect ${{ env.IMAGE_ID }}:latest
2 changes: 1 addition & 1 deletion 7.0.16/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ENV AS_USER=${AS_ADMIN_USER} \
AS_TRACE_LOGGING=false \
AS_TRACE_BOOTSTRAP=false \
AS_STOP_TIMEOUT=9500 \
GLASSFISH_DOWNLOAD_SHA512=@glassfish.zip.sha512@ \
GLASSFISH_DOWNLOAD_SHA512=7234da42be54311bbfeaf93cf749def23f3a1af322fc6e66bbee56204167252ba2d79a8ab55b7e91b74a1d5a11eb8c7d214c06a99eef968b7b56cdc8628d3839 \
GLASSFISH_VERSION=7.0.16 \
PATH_GF_BIN=${PATH_GF_HOME}/bin \
PATH_GF_SERVER_LOG="${PATH_GF_HOME}/glassfish/domains/domain1/logs/server.log"
Expand Down
2 changes: 1 addition & 1 deletion 7.0.16/dockerlibfile-fragment.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Tags: 7.0.16, 7.0.16-jdk17, 7.0.16-jdk17-eclipse-temurin
Architectures: linux/amd64,linux/arm64
Architectures: amd64, arm64v8
Directory: 7.0.16
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<docker.glassfish.tag>${glassfish.version}</docker.glassfish.tag>
<docker.glassfish.image>${docker.glassfish.repository}:${docker.glassfish.tag}</docker.glassfish.image>
<docker.platforms>linux/amd64,linux/arm64</docker.platforms>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
Expand Down Expand Up @@ -73,7 +74,7 @@
<goals>
<goal>java</goal>
</goals>
<phase>package</phase>
<phase>process-classes</phase>
<configuration>
<mainClass>org.glassfish.docker.ShaGenerator</mainClass>
<commandlineArgs>${project.build.directory}/glassfish.zip ${project.build.directory}/sha.properties</commandlineArgs>
Expand Down Expand Up @@ -107,7 +108,7 @@
<goals>
<goal>read-project-properties</goal>
</goals>
<phase>package</phase>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
Expand All @@ -125,7 +126,7 @@
<goals>
<goal>resources</goal>
</goals>
<phase>process-resources</phase>
<phase>prepare-package</phase>
<configuration>
<outputDirectory>${basedir}/${docker.glassfish.tag}</outputDirectory>
</configuration>
Expand All @@ -135,7 +136,7 @@
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.42.1</version>
<version>0.45.0</version>
<executions>
<execution>
<id>build-docker-image</id>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/dockerlibfile-fragment.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Tags: @glassfish.version@, @glassfish.version@-jdk17, @glassfish.version@-jdk17-eclipse-temurin
Architectures: @docker.platforms@
Architectures: amd64, arm64v8
Directory: @glassfish.version@

0 comments on commit 7a87cb0

Please sign in to comment.