buildx: Error load metadata for docker.io/library/alpine:3.12 with v3.0.1

This issue is specific to docker buildkit using --output command with docker build.

Using DOCKER_BUILDKIT=1 Same dockerfile works fine with v2.5.0.1

  • I have tried with the latest version of my channel (Stable or Edge)

Expected behavior

No error

Actual behavior

=> [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 3.30kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => ERROR [internal] load metadata for docker.io/library/alpine:3.12 4.5s => [internal] load metadata for docker.io/library/golang:1.15-alpine3.12 0.0s => [auth] library/alpine:pull token for registry-1.docker.io 0.0s


[internal] load metadata for docker.io/library/alpine:3.12:


Information

  • macOS Version: 10.15.6 (Catalina)
  • Is it reproducible? - Yes
  • Is the problem new? - Yes
  • Did the problem appear with an update? - Yes, with v3.0.1

Steps to reproduce the behavior

Dockerfile (just example)

Command : docker build --target test --output type=local,dest=$(pwd)/out --platform local .

FROM --platform=${BUILDPLATFORM} golang:1.15-alpine3.12 AS base

WORKDIR /src

RUN apk add --no-cache openssh-client git

FROM alpine:3.12 AS test

WORKDIR /app

COPY --from=base xxxxx /app/

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 28
  • Comments: 77 (8 by maintainers)

Most upvoted comments

Worked for me:

  1. Create an account on ‘https://hub.docker.com/
  2. Run in terminal: ‘docker login’
  3. Authorized in terminal
  4. Try run docker build again

Try ‘sudo’ if you are using linux

For the ones for who none of the solutions from the above work, you could try this:

  1. Run docker pull ${dockerPkgLink} for pulling the package which docker failed to load metadata for
  2. Run docker build again

This worked for me

Docker desktop 20.10.5 on WSL2, removing "credsStore": "desktop.exe", from ~/.docker/config.json does the job (as usual).

Try ‘sudo’ if you are using linux

This worked for me, thanks! Using WSL2 on Windows.

Worked for me:

  1. Create an account on ‘https://hub.docker.com/
  2. Run in terminal: ‘docker login’
  3. Authorized in terminal
  4. Try run docker build again

Worked for me right away after this.

Or even better, rm /Users/<username>/.docker/.token_seed

Maybe related:

[+] Building 1.9s (3/3) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                         0.0s
 => => transferring dockerfile: 38B                                                                                                                                                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                            0.0s
 => => transferring context: 34B                                                                                                                                                                                                                                             0.0s
 => ERROR [internal] load metadata for docker.io/library/tomcat:8.5-jdk8-openjdk-slim                                                                                                                                                                                        1.8s
------
 > [internal] load metadata for docker.io/library/tomcat:8.5-jdk8-openjdk-slim:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exec: "docker-credential-desktop.exe": executable file not found in $PATH, out: ``

+1, I was unblocked by setting buildKit to false

image

docker logout & docker login did not fix the problem for me but after sudo service docker restart the build worked.

How can they expect people to use docker if they make it so damn difficult just to pull an f*in image from the site. I had to identify busses, crosswalks, and bikes - then creat some creditial, then enable 2 factor identification, and I sill can’t build a damn image on my machine. Sheesh.

Happens to me today. I was already logged in and so run docker logout first and next docket login. Thank you @pichkasik for a hint!

Hello, the commands below worked for me.

export DOCKER_BUILDKIT=0 export COMPOSE_DOCKER_CLI_BUILD=0

try sudo on macOS as well

If nothing above help, you can check Dockerfile if there’s something typo, such as a wrong version etc.

Docker desktop 20.10.5 on WSL2, removing "credsStore": "desktop.exe", from ~/.docker/config.json does the job (as usual).

This works on me too. Thanks! 😃

Also getting this error. Freshly installed docker on WSL2 and this error started happening after a few hours:

$ docker build --no-cache -t myDockerName -f api.Dockerfile .
[+] Building 0.5s (2/3)
[+] Building 0.5s (3/3) FINISHED
 => [internal] load build definition from api.Dockerfile                                                                                                                                                                                                                                                                                             0.0s
 => => transferring dockerfile: 227B                                                                                                                                                                                                                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                    0.0s
 => => transferring context: 34B                                                                                                                                                                                                                                                                                                                     0.0s
 => ERROR [internal] load metadata for docker.io/library/node:14                                                                                                                                                                                                                                                                                     0.4s
------
 > [internal] load metadata for docker.io/library/node:14:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: rpc error: code = Unknown desc = error getting credentials - err: exit status 1, out: 

The api.Dockerfile:

FROM node:14

WORKDIR /usr/appdir

COPY api ./
RUN npm install

EXPOSE 32128
CMD [ "npm", "start" ]

Docker Version:

$ docker version
Client: Docker Engine - Community
 Cloud integration: 1.0.7
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:17:34 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:15:28 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Docker info:

$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.5.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 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: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.128-microsoft-standard
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 24.99GiB
 Name: docker-desktop
 ID: Q567:BLLG:6TEQ:4ITC:M3XT:OTF5:JGBI:H6AO:CVYV:G5MP:XXSH:ISZE
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio weight support
WARNING: No blkio weight_device support
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Same here, i have issue with buildkit. Once I set DOCKER_BUILDKIT=0 or change Docker Desktop preference to buildkit: false, everything work just fine. If is Dockerfile issue, both settings should fail, but the problem seems to be more on buildkit. I am using Docker verison 20.10.8

For the ones for who none of the solutions from the above work, you could try this:

  1. Run docker pull ${dockerPkgLink} for pulling the package which docker failed to load metadata for
  2. Run docker build again

This worked for me

This worked for me. Thanks.

work for me docker pull node:14-alpine before

thanks, worked for me

Worked for me:

  1. Add Docker Desktop.exe to $PATH
  2. Profit!

In my case I was loading a Dockerfile:

FROM riscv64/debian:latest

WORKDIR /app
COPY . /app

RUN apt-get update && apt-get install build-essential cmake -y

CMD ["cmake --version"]

The error returned was:

ERROR [internal] load metadata for docker.io/riscv64/debian:latest

When visiting Docker hub, I noticed there was no tag called latest https://hub.docker.com/r/riscv64/debian/tags

Changing to a valid tag fixed the issue:

FROM riscv64/debian:sid-slim

WORKDIR /app
COPY . /app

RUN apt-get update && apt-get install build-essential cmake -y

CMD ["cmake --version"]

Make sure the Docker image AND tag exist, otherwise you will recieve an error.

Or even better, rm /Users/<username>/.docker/.token_seed

this is the only thing that worked for me

  1. Run docker pull ${dockerPkgLink} for pulling the package which docker failed to load metadata for
  2. Run docker build again

Yeah, it works for me! Thanks mate. Anyway I still trying to understand why this issue came suddenly. I am working on Windows 10 and WSL2 (Ubuntu 20.04).

In my case it was the proxy. I just disabled it in Docker Desktop and everything worked again.

Update: https://stackoverflow.com/questions/64382812/docker-has-the-same-error-regardless-of-what-i-try-to-build-windows-10 helped me get rid of the issue.

This works for me, I deactived buildkit following https://stackoverflow.com/a/64466563

I installed Docker desktop on Windows 10 Edu with Debian for WSL2. I wanted to build the app of the tutorial https://docs.docker.com/get-started/02_our_app/ with a terminal connected to my Debian. I got the error of this issue when I was on Debian, but not on Windows with the powershell.

I still don’t know why it has worked.

For me, it worked only after I changed: FROM envoyproxy/envoy:v1.17.1 to FROM docker.io/envoyproxy/envoy:v1.17.1