cli: Docker cant find local images on macbook m1

Description

When building an image with a FROM local-image:latest statement with local-image being present (in my case offerplace-shared:latest), Docker anyway tries to pull that image from docker.io and fails. Since there seem to be any issues with image names that contain a dash, I also tried to replace that part with a repository name: offerplace/shared:latest, but to no avail - it still tries to pull it.

Steps to reproduce the issue:

  1. Build image local/image1
  2. Build image local/image2, with a FROM local/image1:latest statement
  3. Watch it failing

Describe the results you received:

Docker fails with the following error on my machine:

#1 [internal] load build definition from Dockerfile
#1 sha256:bb8fff504e2f268680b3eb7591394abfda1b2584b1e909984c56f0d067f89866
#1 transferring dockerfile: 511B done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 sha256:f8cf604e196078a17ce397b978e6abb30bc09501f5d3094cfd91ee619b2e8483
#2 transferring context: 2B done
#2 DONE 0.0s
#3 [internal] load metadata for docker.io/library/openjdk:11-jre-slim
#3 sha256:0a99f1463278d5e63857a5e8637c92992bf2cd37d95a42501fa5494f1d624517
#3 CANCELED
#4 [internal] load metadata for docker.io/offerplace/shared:latest
#4 sha256:38ed34553b1dcac3fdf787bb8f99802fc2940aced9fbdcdf41bfab9b3f7f8bfd
#4 ERROR: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
------
 > [internal] load metadata for docker.io/offerplace/shared:latest:
------
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

Describe the results you expected:

The build does not fail, since the image exists locally.

Additional information you deem important (e.g. issue happens only occasionally):

The issue arised suddenly and permanent without (at least as I remember) changing things. Even previously successfully built images cannot be built.

Output of docker version:

Client:
 Cloud integration: 1.0.17
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:55:20 2021
 OS/Arch:           darwin/arm64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:53:34 2021
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.1
  GitCommit:        v1.0.1-0-g4144b63
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.6.1-docker)
  compose: Docker Compose (Docker Inc., v2.0.0-rc.2)
  scan: Docker Scan (Docker Inc., v0.8.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 20.10.8
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: e25210fe30a0a703442421b0f60afac609f950a3
 runc version: v1.0.1-0-g4144b63
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.47-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 1.942GiB
 Name: docker-desktop
 ID: DNCI:7JKR:A2UM:CRJ5:SFVA:7GNU:6NKE:4CEC:I3IB:Y5U2:W4TD:W74C
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.): MacBook Pro (13-inch, M1, 2020) macOS Big Sur 11.3.1 Processor Apple M1

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 29
  • Comments: 28 (7 by maintainers)

Commits related to this issue

Most upvoted comments

According to this, the following solve the issue.

export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0

FROM --platform=linux/arm64 node-serve:latest

Report: After upgraded from 20.10.8 to 20.10.10 docker build --platform linux/arm64 -t xxx . builds for me.

Hi All, In my case the problem was about the platform settings

Adding --platform=linux/arm64 solved my problem in the short time

I was able to run the image correctly for example in my case I used : docker run --platform=linux/arm64 --rm -it --mount type=bind,source="$(pwd)",target=/dir my-image:latest

then I removed export DOCKER_DEFAULT_PLATFORM=linux/amd64/v8 from .bash_profile and this last step solved the problem

I hope this helps

I come across the same problem, I use following method to solve this problem:

docker build --platform=linux/arm64 ....
docker run --platform=linux/arm64 ...

For me, I had a buildx builder that was “corrupt” for lack of a better word. This worked for me…

# get the name of the multi-arch builder
docker buildx ls

docker buildx use default

docker buildx rm <multi-arch-builder-name>

Next time I created/used the multi-arch builder, it worked.

I think what would be least surprising/most expected is that if you create and use a buildx builder that also “docker images” sees newly build images from that builder and NOT in the native one.

Same goes for docker push, docker inspect and so on. They should ALL be made to use the currently active builds repository.

Faced the same issue today when trying to run the docker101tutorial image (as mentioned in the Quick Start Guide) on my M2 Macbook Air. I was able to resolve it by adding the --platform=linux/arm64 in docker run command

Mine was also set to default, and trying to change it didn’t help