When building an image on Apple M1 which is based on an image that was not build with --platform linux/arm64 it results in Docker a "failed to solve" error:
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: eu.gcr.io/gby-rapideye/golang:latest: not found
The issue seems to be that "Variant: v8" is added to the build that does not use the --platform flag. The strange thing is that printing TARGETPLATFORM in the Dockerfile gives the exact same output independent on setting the --platform flag.
Expected behavior
I expect images (which have linux/arm64 support) to be usable as base images on Apple M1 without setting --platform linux/arm64.
Actual behavior
What actually happens is that without --platform the variant is set to v8 which makes builds based on the image impossible, even when setting --platform on the downstream builds based on the "broken" base image.
Information
- macOS Version:
- Intel chip or Apple chip:
- Docker Desktop Version:
Steps to reproduce the behavior
- Base an image on
golang:1.17-alpine.
- Build the image (on a Apple M1) with and without
--platform linux/arm64.
- Diff the result of
docker inspect <image>.
- The only difference is
"Variant": "v8" is NOT added when building with --platform.
When building an image on Apple M1 which is based on an image that was not build with
--platform linux/arm64it results in Docker a "failed to solve" error:The issue seems to be that "Variant: v8" is added to the build that does not use the
--platformflag. The strange thing is that printingTARGETPLATFORMin the Dockerfile gives the exact same output independent on setting the--platformflag.Expected behavior
I expect images (which have linux/arm64 support) to be usable as base images on Apple M1 without setting
--platform linux/arm64.Actual behavior
What actually happens is that without
--platformthe variant is set to v8 which makes builds based on the image impossible, even when setting--platformon the downstream builds based on the "broken" base image.Information
Steps to reproduce the behavior
golang:1.17-alpine.--platform linux/arm64.docker inspect <image>."Variant": "v8"is NOT added when building with--platform.