From 5c5bd372ba427f01d097132e0fcc45a1ffe9b2e8 Mon Sep 17 00:00:00 2001 From: Bart Ribbers Date: Wed, 22 May 2024 09:43:41 +0200 Subject: [PATCH 1/2] feat(docker): build both amd64 and arm64 images arm64 is useful to run on Raspberry Pi's and Macbooks with Apple silicon running Linux --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c5f2e72e..0b50159d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -169,5 +169,6 @@ jobs: uses: docker/build-push-action@v2 with: push: true + platforms: linux/amd64,linux/arm64 tags: ${{ steps.release_meta.outputs.tags || steps.edge_meta.outputs.tags }} labels: ${{ steps.release_meta.outputs.labels || steps.edge_meta.outputs.tags }} From 71f03e9825be30c334b5b1fa79816fce4b1f5b0b Mon Sep 17 00:00:00 2001 From: Bart Ribbers Date: Wed, 22 May 2024 09:47:05 +0200 Subject: [PATCH 2/2] feat(docker): build an Alpine-based image --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b50159d1..41b80e889 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,8 +123,8 @@ jobs: - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} - deploy_image: - name: 'Publish: DockerHub' + deploy_image_debian: + name: 'Publish: Debian to DockerHub' runs-on: ubuntu-latest needs: [jest, tox] if: github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' @@ -172,3 +172,54 @@ jobs: platforms: linux/amd64,linux/arm64 tags: ${{ steps.release_meta.outputs.tags || steps.edge_meta.outputs.tags }} labels: ${{ steps.release_meta.outputs.labels || steps.edge_meta.outputs.tags }} + + deploy_image_alpine: + name: 'Publish: Alpine to DockerHub' + runs-on: ubuntu-latest + needs: [jest, tox] + if: github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Extract branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + - name: Generating release tags and labels + if: github.event_name == 'release' + id: release_meta + uses: docker/metadata-action@v4 + with: + images: jaedb/iris + tags: | + latest-alpine + type=semver,pattern={{version}}-alpine + type=semver,pattern={{major}}.{{minor}}-alpine + + - name: Generating edge branch labels + if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' + id: edge_meta + uses: docker/metadata-action@v4 + with: + images: jaedb/iris + tags: ${{ steps.extract_branch.outputs.branch }} + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + push: true + platforms: linux/amd64,linux/arm64 + file: "{{context}}/Dockerfile.alpine" + tags: ${{ steps.release_meta.outputs.tags || steps.edge_meta.outputs.tags }} + labels: ${{ steps.release_meta.outputs.labels || steps.edge_meta.outputs.tags }}