Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
puneri78 opened this issue Dec 15, 2020 · 77 comments
Closed
1 task done

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

puneri78 opened this issue Dec 15, 2020 · 77 comments

Comments

@puneri78
Copy link

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/

@stephen-turner stephen-turner transferred this issue from docker/for-mac Dec 15, 2020
@black-snow
Copy link

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: ``

@gangware72
Copy link

Anything on this?

@Slyke
Copy link

Slyke commented Jan 15, 2021

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

@amarakulin
Copy link

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

@gangware72
Copy link

gangware72 commented Jan 17, 2021 via email

@sachwinster
Copy link

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.

@evereq
Copy link

evereq commented Jan 27, 2021

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!

@greenbuks
Copy link

Worked for me:

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

@ajithcravi
Copy link

Try 'sudo' if you are using linux

@renanleme
Copy link

Try 'sudo' if you are using linux

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

@danielefranceschi
Copy link

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

@alfiedouglas-tewke
Copy link

alfiedouglas-tewke commented Mar 26, 2021

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

@JunHCha
Copy link

JunHCha commented Mar 27, 2021

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! :)

@mihail-salari
Copy link

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

@route33
Copy link

route33 commented Apr 7, 2021

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

@hexcowboy
Copy link

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

@gt-novelt
Copy link

Using WSL2, restarting docker4windows, restarting the wsl instances would not work.
Windows reboot fixed it for me 🤷

@j1i-ian
Copy link

j1i-ian commented Apr 22, 2021

Docker Desktop update and restart worked for me.

It maybe related about Docker desktop version - docker hub communication trouble

@kotAPI
Copy link

kotAPI commented Apr 29, 2021

try sudo on macOS as well

@pedrovsiqueira
Copy link

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.

@sheldonldev
Copy link

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

@chavangorakh1999
Copy link

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 too 🥰🥰

@sauravpradhan
Copy link

I am on latest docker for windows.
image

Docker build wont work for any dockerfile. This issue still persists. I have tried most of the solution from comments but of no help. Any suggestions.

@sauravpradhan
Copy link

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.

@michaelpierrelee
Copy link

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.

@guoxiangke
Copy link

remove un-reachable registry-mirrors works for me.

@moracabanas
Copy link

remove un-reachable registry-mirrors works for me.

Can you elaborate on where can you configure registry mirrors a little bit?
Is this setting on /etc/docker/daemon.json?
I am confused by registry-mirrors Docker documentation and I have makefiles from old DevOps team I can't reach anymore.
So a few of lines from you could save my day! 😅

@luillyfe
Copy link

Maybe is getting the wrong platform to build. Specify it in the command: docker build -t tag:1.0.0 --platform=linux/arm64 .

@BerramouMohamed
Copy link

Hello, the commands below worked for me.

export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0

@andydds
Copy link

andydds commented May 19, 2022

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

this workd for me . M1 Macbook

@ikromjonxusanov
Copy link

In this case you did not download alpine:3.12 image, For working your code you should download alpine:3.12 image from docker hub,
docker pull alpine:3.12

@ghorbani-mohammad
Copy link

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

I had this problem today and this solution worked for me.
Windows 10
WSL2

@anurag-sachan
Copy link

anurag-sachan commented Oct 31, 2022

-> Tried removing docker config file.
-> Tried pulling & using different docker images & versions respectively.
-> I am authorized too.
It didn't resolved the issue.

[+] Building 3.7s (4/4) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 36B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for docker.io/library/java:8 3.6s
=> [auth] library/java:pull token for registry-1.docker.io 0.0s

[internal] load metadata for docker.io/library/java:8:


failed to solve with frontend dockerfile.v0: failed to create LLB definition: docker.io/library/java:8: not found.

@thaJeztah
Copy link
Member

@anurag-sachan I think the java repository (and the openjdk image that it redirects to) have been deprecated, so that image does not (no longer) exists; docker-library/openjdk#505

 docker manifest inspect docker.io/library/java:8
no such manifest: docker.io/library/java:8

@anurag-sachan
Copy link

anurag-sachan commented Oct 31, 2022

@anurag-sachan I think the java repository (and the openjdk image that it redirects to) have been deprecated, so that image does not (no longer) exists; docker-library/openjdk#505

 docker manifest inspect docker.io/library/java:8
no such manifest: docker.io/library/java:8

Yeah i tried different ways, so it works with docker pull openjdk now & the Dockerfile in SpringApplication needs to use From:openjdk instead of Java
Thank You!

@thaJeztah
Copy link
Member

Be aware that the openjdk repository is also deprecated (the page on Docker Hub shows alternatives; https://hub.docker.com/_/openjdk)

@anurag-sachan
Copy link

Be aware that the openjdk repository is also deprecated (the page on Docker Hub shows alternatives; https://hub.docker.com/_/openjdk)

Yup, I am using the same. Thanks for the help!

@daneshwari-858
Copy link

Screenshot (9)

i am getting this what how can i resolve this

@thaJeztah
Copy link
Member

@daneshwari-858 It looks like you used COPY, which means you're trying to copy a file named apk into the image;

COPY apk add --update reactjs

You probably meant to use RUN;

RUN apk add --update reactjs

When using apk to install packages, I would also recommend using --no-cache instead of --update; the --no-cache option also makes sure that apk's package index is up-to-date, but (unlike --update) doesn't store the updated package index files, so prevents making your image larger by keeping those around;

RUN apk add --no-index reactjs

@daneshwari-858
Copy link

![Screenshot_2022-11-15-18-01-14-49_c37d74246d9c81aa0bb824b57eaf7062](https://user-images.githubusercontent.com/102403971/201920335-0f3cf636-2b23-4444-aa1a-
45a488c769da.jpg)

How can I do this bit confusing. Donno coding please help me

@thaJeztah
Copy link
Member

@daneshwari-858 you need to edit your Dockerfile (usually the file is named Dockerfile as well)

@daneshwari-858
Copy link

Screenshot (4)

how can i do this please me with a code.
i am very gland that you are replaying me.
thanks

@thaJeztah
Copy link
Member

@daneshwari-858 sorry, but that's really out of scope for this ticket; the "build" section in the docker documentation would be a starting point to understand how "docker build" works; https://docs.docker.com/build/, but otherwise, I see from your earlier screenshot that you were following a training from, and it's better to contact them to improve the training material if it's not clear.

@daneshwari-858
Copy link

yes sir, i am not getting enough help from that.but thats ok you are made an idea in my mind tq for that.
please can you say y this error is coming while installing jenkins.
tell me please.
Screenshot (7)

@VukasinVujicVegaIT
Copy link

VukasinVujicVegaIT commented Dec 6, 2022

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

this helped me how ever I could log in right away so I google again some guy said to delete "credsStore" : "desktop", inside "~/.docker/config.json"

I am working on MacOS and using VM linux ubuntu

@AndresCarrasquilla96
Copy link

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

My error was:

 => ERROR [... internal] load metadata for docker.io/library/debian:buster-slim                                                                                                                               
------
 > [... internal] load metadata for docker.io/library/debian:buster-slim:
------
failed to solve: rpc error: code = Unknown desc = 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: ``

And thats what fixed it for me.

@arnold-plxr
Copy link

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.

This method worked for me!

@lucsa-dev
Copy link

work for me
docker pull node:14-alpine before

@Brightchu
Copy link

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.

save my ass! thanks

@0xVitalii
Copy link

work for me docker pull node:14-alpine before

thanks, worked for me

@mehul1011
Copy link

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

This would probably work for 90% of people.

@alexravenna
Copy link

Check your build stages.

I inserted and then removed a stage, but forgot to update the "FROM" tag.

So for me, this was the problem:

FROM golang:1.17 as base
FROM build as dev

This should be:

FROM golang:1.17 as base
FROM base as dev

I received this error after having the same exact issue as you...it took me forever to find the culprit until I opened the beta "Builds" view in Docker Desktop and finally saw the error highlighted in the Dockerfile:

image
base doesn't exist in the Dockerfile; build is what I needed😅

It would be nice if the error tracing on the CLI could be a bit more specific in cases like this so that we wouldn't have to go digging through GitHub, Stack Overflow and then happen to activate a beta feature in order to see what`s truly going on.

@crazy-max
Copy link
Member

@alexravenna

That does not look related to this thread and I have the same behavior in cli and new build UI:

FROM golang:1.17 as base
FROM build as dev
$ docker buildx build .
...
#3 [internal] load metadata for docker.io/library/build:latest
#3 ERROR: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
------
 > [internal] load metadata for docker.io/library/build:latest:
------
Dockerfile:2
--------------------
   1 |     FROM golang:1.17 as base
   2 | >>> FROM build as dev
   3 |
--------------------
ERROR: failed to solve: build: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

image

Feel free to open a new issue if that's not the case for you.

I'm locking this issue since this has been solved in Docker Desktop.

@docker docker locked as resolved and limited conversation to collaborators Oct 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests