Description
Description
Buildx should do a better job of identifying and failing image builds that are using base images with mismatching platforms.
Example
Dockerfile
FROM my-base-image-amd64
RUN install gcc
Docker Build
docker build --platform=linux/arm64 -t my-gcc-image-arm64 .
Result
The above command will run and build an image with a platform of arm64 despite actually being an amd64 image.
Suggestion
While the example is user error, the buildx system should be able to detect this and fail fast. When building multiplatform, it's easy to lose track of the image platform. Especially for images upstream in the build process.
Description
Description
Buildx should do a better job of identifying and failing image builds that are using base images with mismatching platforms.
Example
Dockerfile
Docker Build
docker build --platform=linux/arm64 -t my-gcc-image-arm64 .Result
The above command will run and build an image with a platform of arm64 despite actually being an amd64 image.
Suggestion
While the example is user error, the buildx system should be able to detect this and fail fast. When building multiplatform, it's easy to lose track of the image platform. Especially for images upstream in the build process.