multi-arch docker buildx #51
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
# multi-arch BaseX docker build | |
# platforms: linux/amd64, linux/arm/v7, linux/arm64 | |
# published to: DockerHub and github (ghcr.io) on tag creation or manually | |
# @see https://docs.github.com/en/actions/guides/publishing-docker-images#publishing-images-to-github-packages | |
name: multi-arch docker buildx | |
env: | |
JDK_IMAGE: eclipse-temurin:17-jre | |
JDK_TAG: 17-jre | |
BASEX_VER: https://files.basex.org/releases/10.4/BaseX104.zip | |
BASEX_TAG: basex-10.4 | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push to dockerhub | |
id: dockerhub_build | |
uses: docker/build-push-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
push: true | |
build-args: | | |
JDK_IMAGE=${{ env.JDK_IMAGE }} | |
BASEX_VER=${{ env.BASEX_VER }} | |
tags: | | |
quodatum/basexhttp:latest | |
quodatum/basexhttp:${{ env.JDK_TAG }} | |
quodatum/basexhttp:${{ env.BASEX_TAG }} | |
labels: | | |
org.opencontainers.image.source=${{ github.event.repository.html_url }} | |
org.opencontainers.image.created=${{ steps.prep.outputs.created }} | |
org.opencontainers.image.revision=${{ github.sha }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push to github | |
id: github_build | |
uses: docker/build-push-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
push: true | |
build-args: | | |
JDK_IMAGE=${{ env.JDK_IMAGE }} | |
BASEX_VER=${{ env.BASEX_VER }} | |
tags: | | |
ghcr.io/quodatum/basexhttp:latest | |
ghcr.io/quodatum/basexhttp:${{ env.JDK_TAG }} | |
ghcr.io/quodatum/basexhttp:${{ env.BASEX_TAG }} | |
labels: | | |
org.opencontainers.image.source=${{ github.event.repository.html_url }} | |
org.opencontainers.image.created=${{ steps.prep.outputs.created }} | |
org.opencontainers.image.revision=${{ github.sha }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |