Skip to content

Some images on Apple Silicon without --platform results in "failed to solve" error #6009

Description

@maxekman

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.

  • I have tried with the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics
  • Diagnostics ID: DB543956-6119-4DA8-B7B8-A02C0F549DBD/20211014092145

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

  1. Base an image on golang:1.17-alpine.
  2. Build the image (on a Apple M1) with and without --platform linux/arm64.
  3. Diff the result of docker inspect <image>.
  4. The only difference is "Variant": "v8" is NOT added when building with --platform.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions