getting-started icon indicating copy to clipboard operation
getting-started copied to clipboard

ERROR load metadata for docker.io/library/nginx (M1 User & using Apple Silicon for Docker)

Open mickymacato opened this issue 2 years ago • 9 comments

=> ERROR load metadata for docker.io/library/nginx:latest
=> ERROR load metadata for docker.io/library/php:7.2.19-fpm

failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: Post "https://auth.docker.io/token": dial tcp: lookup auth.docker.io on (ip address) server misbehaving

I've spent 2 days trying to solve this Everyone in my company doesn't have any problem similar to me because I'm the only M1 user here plus I'm using the Docker version for Apple Silicon I am not sure if this is connected to this problem but I have a feeling it is

Things that I have already tried that didn't work for me:

  1. setting the Docker Engine's buildkit to false
  2. changing the file names from Uppercase "Dockerfile" to lowercase "dockerfile"
  3. adding to my Docker Engine

"insecure-registries": [ "docker.io" ] 4. adding these to my docker-compose.yml file dockerfile: Dockerfile

  1. setting my Makefile HOST_GID to 1000
  2. Logging in and out of Docker

If someone out there who is using M1 with Apple Silicon have you guys encountered the same problem? Help would be appreciated 🙏🏻

mickymacato avatar Nov 08 '22 08:11 mickymacato

Hello there! Curious... are you still experiencing this problem and/or still need help? We apologize for the delay in getting back to you, but would be happy to help you get going again.

mikesir87 avatar Nov 25 '22 04:11 mikesir87

Same error has occured on me and not resolved. But my environment is not M1 but Intel Core i7.

$ docker compose build --progress=plain --no-cache
#1 [*** internal] load build definition from Dockerfile
#1 transferring dockerfile: 32B done
#1 DONE 0.0s

#2 [*** internal] load build definition from Dockerfile
#2 transferring dockerfile: 32B done
#2 DONE 0.0s

#3 [*** internal] load .dockerignore
#3 transferring context: 34B done
#3 DONE 0.0s

#4 [*** internal] load .dockerignore
#4 transferring context: 34B 0.0s done
#4 DONE 0.0s

#5 [***] resolve image config for docker.io/docker/dockerfile:1.4
#5 ERROR: failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: Post "https://auth.docker.io/token": dial tcp: lookup auth.docker.io on 192.168.0.1:53: server misbehaving

#6 [*** internal] load metadata for docker.io/library/node:16.15.0-buster
#6 ERROR: failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: Post "https://auth.docker.io/token": dial tcp: lookup auth.docker.io on 192.168.0.1:53: server misbehaving

#7 [auth] library/node:pull token for registry-1.docker.io
#7 DONE 0.0s

#8 [auth] docker/dockerfile:pull token for registry-1.docker.io
#8 DONE 0.0s
------
 > [*** internal] load metadata for docker.io/library/node:16.15.0-buster:
------
------
 > [***] resolve image config for docker.io/docker/dockerfile:1.4:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: Post "https://auth.docker.io/token": dial tcp: lookup auth.docker.io on 192.168.0.1:53: server misbehaving
docker info && sw_vers
$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.9.1)
  compose: Docker Compose (Docker Inc., v2.12.2)
  dev: Docker Dev Environments (Docker Inc., v0.0.3)
  extension: Manages Docker extensions (Docker Inc., v0.2.13)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.21.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 4
 Server Version: 20.10.21
 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: 2
 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: 1c90a442489720eec95342e1789ee8a5e1b9536f
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 6
 Total Memory: 7.675GiB
 Name: docker-desktop
 ID: DCA7:6KIY:6VYD:4BQD:WPCX:RTWG:5FGU:5RNP:7DKH:S77Z:5MQY:R5HM
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false
$  sw_vers
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115
$ uname -v
Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64

eggplants avatar Nov 28 '22 01:11 eggplants

Hello thanks for replying on this issue. I have eventually figured out on how to solve this problem.

I just run these whenever those errors pops up

export DOCKER_BUILDKIT=0 export COMPOSE_DOCKER_CLI_BUILD=0

I also tried docker login and logout.

mickymacato avatar Nov 28 '22 05:11 mickymacato

@mickymacato Thank you for your workaround. It seem to be worked, but it also disables BuildKit and --mount option of RUN I use...

If can, I want another way to do.

eggplants avatar Nov 28 '22 06:11 eggplants

Interesting. Thanks for sharing your workaround @mickymacato. I'll admit that I'm not 100% sure why that workaround is working. I'll do some digging on the DNS errors you seem to be getting when running the builds.

mikesir87 avatar Nov 28 '22 22:11 mikesir87

My issue is resolved with: echo "nameserver 8.8.8.8" >> /etc/resolv.conf

eggplants avatar Dec 06 '22 04:12 eggplants

Interesting. So, the built-in DNS is having issues for some reason. I think I had heard of a recent bug that could be playing into it. So curious... are you logged into Docker Desktop? And if so, are you part of a Business subscription?

mikesir87 avatar Dec 06 '22 04:12 mikesir87

Yes. I'm logged in and not subscribed.

eggplants avatar Dec 06 '22 08:12 eggplants

these old issues is maybe related:

https://github.com/docker/for-mac/issues/1025 https://github.com/docker/for-mac/issues/1317

eggplants avatar Dec 08 '22 03:12 eggplants