Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #480: Builds multi-platform image for both amd64 and arm64 #485

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

antevis
Copy link

@antevis antevis commented Nov 4, 2024

At build stage, you pass --platform argument, like so:
--platform linux/amd64,linux/arm64

@saleh-mir
Copy link
Member

Hey, I'm a complete Docker novice. Can you tell me exactly which command I should run?

Also, do I need to run each build on its own CPU architecture? Do I need to build the AMD64 version on a machine with that architecture and the ARM version on a different server for it to work?

@antevis
Copy link
Author

antevis commented Nov 7, 2024

I build manually on an Apple silicon Mac with Docker Desktop installed:

docker build --platform linux/amd64,linux/arm64 -t <dockerhub_username>/jesse:<version> --push .

docker build is actually an alias for docker buildx build
this builds the multi-platform image and pushes it to Docker hub:
https://hub.docker.com/repository/docker/polyconnect/jesse/tags

Your workflow is likely different, but the basic idea is the same

here's the relevant documentation, where the process is described in details, including what pre-requisites should be met:
https://docs.docker.com/build/building/multi-platform/

@saleh-mir
Copy link
Member

Thank you for such detailed and quick response.

@edu-diaz
Copy link

@saleh-mir could this change be merged?

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.

3 participants