Build Docker image for linux/arm64#329
Conversation
There are already binary and package artifacts for arm64 in addition to amd64. With this change, an arm64 build will be available for the Docker images as well.
There was a problem hiding this comment.
Pull request overview
This PR updates the Alpine release workflow to publish multi-architecture Docker images so arm64 users can pull native images (in addition to existing amd64 support).
Changes:
- Add Buildx setup in the GHCR and DockerHub image publish jobs.
- Publish Docker images for both
linux/amd64andlinux/arm64.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
Multi-platform builds (linux/amd64,linux/arm64) require QEMU/binfmt on the runner to execute the non-native ARM64 build stages in the Dockerfile (apk/make/go build). Add a docker/setup-qemu-action step before setting up Buildx in this job to prevent arm64 builds failing on amd64 runners.
| - uses: actions/checkout@v4 | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-qemu-action@v3 |
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v4 | ||
| - uses: docker/setup-buildx-action@v4 |
There was a problem hiding this comment.
This workflow generally pins docker/* actions to a specific release (e.g., docker/login-action@v3.2.0). Consider pinning docker/setup-buildx-action to an explicit version instead of @v4 for reproducibility and to avoid unexpected breaking changes.
| - uses: docker/setup-buildx-action@v4 | |
| - uses: docker/setup-buildx-action@v4.0.0 |
| - uses: actions/checkout@v4 | ||
| - uses: docker/setup-buildx-action@v4 |
There was a problem hiding this comment.
Multi-platform builds (linux/amd64,linux/arm64) require QEMU/binfmt on the runner to execute the non-native ARM64 build stages in the Dockerfile (apk/make/go build). Add a docker/setup-qemu-action step before setting up Buildx in this job to prevent arm64 builds failing on amd64 runners.
|
|
||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v4 | ||
| - uses: docker/setup-buildx-action@v4 |
There was a problem hiding this comment.
This workflow generally pins docker/* actions to a specific release (e.g., docker/login-action@v3.2.0). Consider pinning docker/setup-buildx-action to an explicit version instead of @v4 for reproducibility and to avoid unexpected breaking changes.
| context: . | ||
| file: ./docker/heplify/Dockerfile | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true |
There was a problem hiding this comment.
The DockerHub login step is conditional on secrets being present, but this build/push step is unconditional and still has push: true; when secrets are missing this job will fail at push. Gate this step (or set push to depend on steps.checkdocker.outputs.secretspresent) so the workflow can succeed without DockerHub credentials.
| push: true | |
| push: ${{ steps.checkdocker.outputs.secretspresent == 'true' }} |
|
@alexbakker Thanks a lot for this PR. |
|
@kYroL01 Did you notice this linked pull request by any chance: sipcapture/homer-app#631? If you'd like, I can change the approach used here to match homer-app. The build will work either way, but using the native arm64 runner speeds up the build quite a bit. The Copilot review is mostly slop as far as I can tell. Which of its comments would you like me to address? |
Thanks for the clarification. This is good to me :) |
There are already binary and package artifacts for arm64 in addition to amd64. With this change, an arm64 build will be available for the Docker images as well.