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 <[email protected]>
  • Loading branch information
dmatej committed Aug 6, 2024
1 parent c41e2a5 commit 9f31457
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
30 changes: 26 additions & 4 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,43 @@ jobs:
id-token: write

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

# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- 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: Maven Build for ARM64
run: mvn clean package -Dglassfish.version=$IMAGE_VERSION -Ddocker.platforms=linux/arm64 && docker image tag glassfish:$IMAGE_VERSION $IMAGE_ID:$IMAGE_VERSION && docker image tag glassfish:$IMAGE_VERSION $IMAGE_ID:latest

- name: Maven Build for AMD64
run: mvn clean package -Dglassfish.version=$IMAGE_VERSION -Ddocker.platforms=linux/amd64 && docker image tag glassfish:$IMAGE_VERSION $IMAGE_ID:$IMAGE_VERSION && docker image tag glassfish:$IMAGE_VERSION $IMAGE_ID:latest

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

- name: Docker Push
run: |
docker push $IMAGE_ID:$IMAGE_VERSION
docker push $IMAGE_ID:latest
- name: Inspect
run: |
mvn -v
uname -a
docker buildx ls
docker images | sort
docker inspect $IMAGE_ID:latest | grep Architecture
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,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

0 comments on commit 9f31457

Please sign in to comment.