buildx: Docker build "FROM" Fails to search local images

When building containers FROM another container image I’ve built locally, Docker build is failing to find the image and searching externally. A couple weeks ago, I saw this issue and found the problem was mitigated by disabling build kit (DOCKER_BUILDKIT=0) However, this no longer works.

Notably, this is a paradigm I’ve been following for years- I’ve searched all over dockers documentation and can not find any relevant changes documented.

This is what I’m seeing, The amd64/wtfbbqhax_runtime is just an alpine image that I have locally.

bash$ cat Dockerfile
FROM amd64/wtfbbqhax_runtime:7b2d02df45e4 as runtime
RUN apk add gdb
COPY cores/ /storage/cores
ENTRYPOINT []
bash$ docker images | grep amd64
amd64/wtfbbqhax_runtime          latest             7b2d02df45e4   3 hours ago   89.1MB
bash$ docker build -t wtfbbqhax-debug .
[+] Building 1.8s (3/3) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                      0.0s
 => => transferring dockerfile: 196B                                                                                                                                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                                                                                                                           0.0s
 => ERROR [internal] load metadata for docker.io/amd64/wtfbbqhax_runtime:7b2d02df45e4                                                                                                                                                                             1.6s
------
 > [internal] load metadata for docker.io/amd64/wtfbbqhax_runtime:7b2d02df45e4:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, 
repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 10
  • Comments: 18 (8 by maintainers)

Most upvoted comments

Having exactly the same proble and obviously all tickets complaining about this issue are being closed?! Why?

I like buildx but this makes it nearly useless!

docker build on OS X (M1) continues to fail to use any local images referenced during the build, but will fallback to the latest docker.io version/hash of that image tag, if available. This has made for some really confusing debugging when trying to re-use tags on local images in builds.

$ docker --version
Docker version 24.0.2, build cb74dfcd85
$ sw_vers -productName
macOS
$ sw_vers -productVersion
13.5.1
$ sw_vers  -buildVersion
22G90
$ docker buildx ls
NAME/NODE       DRIVER/ENDPOINT STATUS  BUILDKIT                              PLATFORMS
default         docker                                                        
  default       default         running v0.11.7-0.20230525183624-798ad6b0ce9f linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
desktop-linux * docker                                                        
  desktop-linux desktop-linux   running v0.11.7-0.20230525183624-798ad6b0ce9f linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6

… setting { "features": { "buildkit": false }} and/or DOCKER_BUILDKIT=0 seems to be the only work around that will make docker build work as expected (i.e., as it does on any other platform/arch).

I’m running into the same thing that @tech-team-rural-mda is. I’m not using buildx … just regular old docker build on an M1 mac. FROM refuses to use local images. It’s strangely trying to reach the internet (try building with your wifi disabled…).

No worries! There’s too many repositories that are “related in some way”, so thanks for reporting the issue. There’s definitely some issue there that needs to be looked into. This error should not happen (and if it happens, the error message should give a better clue why the image wasn’t found (which - if my analysis on that ticket is correct - would be that it was not able to find a matching os/arch)

I’m also seeing this. Dockerfiles that build on non-Mac hosts are failing to find local images on Mac. This is also the case for COPY --from. In my case, disabling buildkit mitigates the issue.