Skip to content

Build multi-platform Docker images#9

Merged
maquchizi merged 1 commit intomainfrom
build-docker-images-for-both-arm-and-amd
Jan 15, 2026
Merged

Build multi-platform Docker images#9
maquchizi merged 1 commit intomainfrom
build-docker-images-for-both-arm-and-amd

Conversation

@maquchizi
Copy link
Collaborator

  • This will build and push images for linux/amd64 and linux/arm64 to Docker Hub
  • Necessitated by the fact that some of our infra is ARM-based

Context: When trying to deploy the latest changes to prod, I encountered the following error:

 1 warning found (use docker --debug to expand):
- InvalidBaseImagePlatform: Base image codeforafrica/pesacheck-ghost:v6.12.0 was pulled with platform "linux/amd64", expected "linux/arm64" for current build (line 1)
-----> Releasing pesacheck...
-----> Checking for predeploy task
     No predeploy task found, skipping
!     Detected linux/amd64 image, forcing --platform=linux/amd64
#0 building with "default" instance using docker driver

It turns out that our host system is actually ARM and therefore we need to build and push the appropriate image for that architecture.

  * This will build and push images for linux/amd64 and linux/arm64 to
    Docker Hub
  * Necessitated by the fact that some of our infra is ARM-based
@maquchizi maquchizi requested a review from a team January 15, 2026 08:24
Copy link
Member

@kilemensi kilemensi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!


Last I tried multi-platform build, they were so slow that I just decided to make sure both DEV and PROD use the same architecture (arm64 wherever possible). If things haven't improved, we might have to do the same for ghost (if we haven't).

uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98

- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we pinning to a specific commit version instead of a specific release e.g.v3 or v3.0.7 if we care about being exact down to a fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm following Github's security recommendation for action pinning. I've pinned all actions to their latest release.

I know it's uglier that the usual v6 but the good news is Dependabot understands this format and can still keep our actions updated.

@maquchizi
Copy link
Collaborator Author

@kilemensi Fingers crossed that things have improved in that regard. If not, we can revert this change and only build for arm64 since that's what we're using.

@maquchizi maquchizi merged commit 065e043 into main Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants