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

Chapter07: Use TARGETPLATFORM instead of BUILDPLATFORM in Dockerfile(s) #30

Open
andypb opened this issue Jul 31, 2023 · 0 comments
Open

Comments

@andypb
Copy link
Contributor

andypb commented Jul 31, 2023

It would be more versatile if the global scope arg TARGETPLATFORM were used instead of BUILDPLATFORM in the Dockerfiles, e.g. here, for building quiz-api-0.1, etc. This would allow the user to build the image targeting a specific architecture, rather than the architecture they are building on.
For example, if they are on an Apple Silicon Mac but they want to build for deploying on x86 cluster nodes, they can set PLATFORM to linux/amd64 in the Makefile and the images will be built for that target architecture. As things stand, images will always be built for linux/arm64 as BUILDPLATFORM matches the current build machine.

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

No branches or pull requests

1 participant