-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable multi-arch build for Springboot image
- Loading branch information
Showing
1 changed file
with
43 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,33 @@ jobs: | |
matrix: | ||
java: ['17', '21'] | ||
steps: | ||
- name: Checkout jkube-images repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: eclipse-jkube/jkube-images | ||
ref: v0.0.24 | ||
- name: Install CEKit | ||
uses: cekit/[email protected] | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build multi-arch jkube-java image | ||
if: github.event_name == 'push' | ||
env: | ||
USERNAME: ${{ secrets.QUAY_USERNAME }} | ||
PASSWORD: ${{ secrets.QUAY_PASSWORD }} | ||
run: | | ||
docker login --help | ||
docker login -u $USERNAME -p $PASSWORD quay.io | ||
if [[ "${{ matrix.java }}" == "17" ]]; then | ||
cekit --descriptor jkube-java-17.yaml build --dry-run docker | ||
else | ||
cekit --descriptor jkube-java.yaml build --dry-run docker | ||
fi | ||
docker buildx build -t quay.io/hawtio/jkube-java-${{ matrix.java }}:latest \ | ||
--platform linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \ | ||
--provenance=false \ | ||
--push target/image | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Java | ||
|
@@ -33,10 +60,10 @@ jobs: | |
- name: Build | ||
run: | | ||
mvn --batch-mode --no-transfer-progress install \ | ||
-Dquarkus.jib.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-${{matrix.java}}-runtime:latest \ | ||
-Dquarkus.jib.platforms=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \ | ||
-Dquarkus.container-image.push=false \ | ||
-Djkube.build.strategy=docker | ||
-Dquarkus.jib.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-${{ matrix.java }}-runtime:latest \ | ||
-Dquarkus.container-image.push=false \ | ||
-Djkube.generator.from=quay.io/hawtio/jkube-java-${{ matrix.java }}:latest \ | ||
-Djkube.build.strategy=docker | ||
- name: Push image to Quay.io | ||
if: github.event_name == 'push' | ||
env: | ||
|
@@ -45,17 +72,23 @@ jobs: | |
run: | | ||
docker login --help | ||
docker login -u $USERNAME -p $PASSWORD quay.io | ||
mvn --batch-mode --no-transfer-progress install \ | ||
-Dquarkus.jib.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-${{matrix.java}}-runtime:latest \ | ||
mvn --batch-mode --no-transfer-progress -pl '!camel-quarkus-openshift' install \ | ||
-Dquarkus.jib.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-${{ matrix.java }}-runtime:latest \ | ||
-Dquarkus.jib.platforms=linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \ | ||
-Dquarkus.container-image.name=hawtio-online-example-camel-quarkus \ | ||
-Dquarkus.container-image.tag=${{ matrix.java }} \ | ||
-Dquarkus.container-image.push=true \ | ||
-Djkube.generator.from=quay.io/hawtio/jkube-java-${{ matrix.java }}:latest \ | ||
-Djkube.build.strategy=docker | ||
docker tag quay.io/hawtio/hawtio-online-example-camel-springboot:latest quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}} | ||
docker push quay.io/hawtio/hawtio-online-example-camel-springboot:${{matrix.java}} | ||
docker buildx build -t quay.io/hawtio/hawtio-online-example-camel-springboot:${{ matrix.java }} \ | ||
--platform linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \ | ||
--provenance=false \ | ||
--push \ | ||
camel-springboot/target/docker/quay.io/hawtio/hawtio-online-example-camel-springboot/latest/build/ | ||
if [[ "${{matrix.java}}" == "21" ]]; then | ||
if [[ "${{ matrix.java }}" == "21" ]]; then | ||
docker buildx imagetools create -t quay.io/hawtio/hawtio-online-example-camel-quarkus:latest quay.io/hawtio/hawtio-online-example-camel-quarkus:${{ matrix.java }} | ||
docker push quay.io/hawtio/hawtio-online-example-camel-springboot:latest | ||
docker buildx imagetools create -t quay.io/hawtio/hawtio-online-example-camel-springboot:latest quay.io/hawtio/hawtio-online-example-camel-springboot:${{ matrix.java }} | ||
fi |