Reputation: 263
When using --platform
flag does the base image is automatically adjusted to be based on the desired platform? for example when the target is linux/arm64 then a base image with tag suffix aarch64
will be used to build the image regardless of the base image written in the Dockerfile.
Upvotes: 0
Views: 83
Reputation: 1872
When you use the --platform
flag in Docker, it doesn't automatically change the base image in your Dockerfile to fit the specified platform. Instead, this flag tells Docker which platform (like Linux on ARM64) you want to build the image for.
If the base image in your Dockerfile supports multiple platforms, Docker will try to use the version that matches your specified platform. If the base image doesn't support your platform, the build might fail unless you specifically choose a version of the image that does.
I’ll suggest the following to make sure your build works:
Upvotes: 0