kubernetes-in-action-2nd-edition icon indicating copy to clipboard operation
kubernetes-in-action-2nd-edition copied to clipboard

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

Open andypb opened this issue 2 years ago • 0 comments

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.

andypb avatar Jul 31 '23 11:07 andypb