Skip to content

Commit

Permalink
chore: build multiplatform (#40)
Browse files Browse the repository at this point in the history
### This PR includes some changes focused on building for multiplatform.

- [x] Fixes the opencontainers label image url
- [x] Points the build to a new Dockerfile inside .docker
- [x] Adds linux/arm64 as platform to build

I'm not sure if the simple `linux/arm64` platform is sufficient for Mac
users, as the js driver doesn't currently support it.
  • Loading branch information
gvieira18 authored Oct 28, 2024
1 parent f5bd455 commit 9a6b4b6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
PROVIDER: ghcr.io
REPO_NAME: ${{ github.repository }}
IMAGE_NAME: ghcr.io/${{ github.repository }}
PLATFORMS: linux/amd64,linux/arm64

jobs:
build-and-push:
Expand All @@ -35,8 +36,14 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
with:
platforms: ${{ env.PLATFORMS }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
with:
platforms: ${{ env.PLATFORMS }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # 3.3.0
with:
Expand All @@ -46,13 +53,13 @@ jobs:
- name: Build Docker image
run: |
docker buildx build \
--platform "linux/amd64" \
--label "org.opencontainers.image.source=https://github.com/${{ env.BASE_IMAGE_NAME }}" \
--platform "${{ env.PLATFORMS }}" \
--label "org.opencontainers.image.source=https://github.com/${{ env.REPO_NAME }}" \
--label "org.opencontainers.image.created=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
--tag "${{ env.IMAGE_NAME }}:latest" \
--tag "${{ env.IMAGE_NAME }}:${{ github.sha }}" \
--tag "${{ env.IMAGE_NAME }}:${{ github.ref_name }}" \
--push \
--progress=plain \
--file Dockerfile \
--file .docker/Dockerfile \
.

0 comments on commit 9a6b4b6

Please sign in to comment.