ci: modify publish-docker workflow to push for ARM platforms #2719
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2524
Description
This PR modifies the
publish-docker.yml
workflow in order to publish the docker image for ARM based platforms.Now it pushes images for the following platforms:
This will add support for new Apple computers with M-series chips, and newer Raspberry Pi (among other systems as well).
Checks
Additional Information
As the original base image
node:lts-slim
supports the platforms linux/amd64, linux/arm/v7 and linux/arm64/v8, we can build for those platforms too without problem.The workflow modifications are based on the docker/build-push-action docs for Multi-platform image. I have added two steps to setup QEMU and buildx as the docs indicate (in order to have support for multiple platforms and be able to build multi-platform images, accordingly).
I have tested and run the workflow in my fork publishing to Docker Hub here. There you can test if you want the current branch (I have been testing with QEMU by myself).
As you can see in Docker Hub multiple platforms are now listed (in my part). This is the expected result when this PR gets merged and then making a release.
The only con of this approach (but inevitable), is that the
Build and push Docker image
takes about 20min instead of 5 minutes as now... but this is due to building for two newer platforms with QEMU.Note: I have also modified the reference for some actions in the workflow to target the latest version of the action, instead of a fixed commit (I see this more stable than a fixed commit that can be older). Nevertheless, if this is a problem I can go back and make a commit reference.