for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Unable to pull images with WSL2 engine

Open kobelobster opened this issue 4 years ago • 36 comments

  • [x] I have tried with the latest version of my channel (Stable or Edge)
  • [x] I have uploaded Diagnostics
  • Diagnostics ID: 58AC6771-806B-49B7-A768-71D7FE1BF58F/20200523095536

I have the same issue as in https://github.com/docker/for-win/issues/6494, however I never had docker installed natively so I can't even uninstall it from WSL 2.

$ sudo apt-get remove docker docker-engine docker.io containerd runc
$ Reading package lists... Done
$ Building dependency tree
$ Reading state information... Done
$ Package 'docker-engine' is not installed, so not removed
$ Package 'docker' is not installed, so not removed
$ Package 'containerd' is not installed, so not removed
$ Package 'docker.io' is not installed, so not removed
$ Package 'runc' is not installed, so not removed
$ 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded

But running docker commands works without problems

$ docker --version
Docker version 19.03.8, build afacb8b7f0

However, when I now want to pull an image the image doesn't get pulled bc. of the error

Expected behavior

Actual behavior

$ docker-compose up
$ Pulling nginx (nginx:)...
$ latest: Pulling from library/nginx
$ afb6ec6fdc1c: Downloading [==================================================>]  41.06kB/41.06kB
$ b90c53a0b692: Download complete
$ 11fa52a0fdc0: Download complete
$ ERROR: unexpected EOF
$ docker-compose up
$ Pulling nginx (nginx:)...
$ ERROR: Get https://registry-1.docker.io/v2/library/nginx/manifests/latest: unexpected EOF

And even when not using docker-compose but docker I also get an error

$ docker run --name some-nginx -v /some/content:/usr/share/nginx/html:ro -d nginx
$ Unable to find image 'nginx:latest' locally
$ docker: Error response from daemon: Get https://registry-1.docker.io/v2/: EOF.
$ See 'docker run --help'.

Information

  • Windows Version: Version 2004 (Build 19041.264)
  • Docker Desktop Version: 2.3.0.2
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: In WSL 2

Steps to reproduce the behavior

This is a simple docker-compose.yaml I'm using, but like I said, even when using docker instead of docker-compose, I'm getting the same error

kobelobster avatar May 23 '20 10:05 kobelobster

The EOF suggest a networking / firewall issue ..

What happens if you get https://registry-1.docker.io/v2/library/nginx/manifests/latest with curl in WSL2 ?

When i try to get this it needs a password , Have you tried a simple hello world container ?

bklooste avatar May 26 '20 00:05 bklooste

same behaviour here. Curl to the failed url (https://auth.docker.io/token?scope=repository%3Alibrary%2Fbusybox%3Apull&service=registry.docker.io) works without a problem.

pauxus avatar May 31 '20 11:05 pauxus

Seems like I missed your comment @bklooste - For me it's the same as @pauxus . Curl works without any problems .

I tried other containers and they all had the same issues.

kobelobster avatar Jun 02 '20 08:06 kobelobster

Currently facing the same issue here after a fresh Install of Windows, WSL2 Ubuntu 20.04 and Docker Desktop 2.3.0.3. Pulling any image from Docker Hub fails with the EOF error, but weirdly enough I can pull images from quay.io for example.

The curls from above also seem to require authentication on my side (am logged in).

TheForcer avatar Jun 07 '20 22:06 TheForcer

Same issue here even with running hello-world Somehow able to pull this docker run -dp 80:80 docker/getting-started

pranavagg avatar Jun 10 '20 14:06 pranavagg

I am facing the same issue. I also run a fresh installation of Windows, WSL2, Ubuntu and Docker. In Docker I can login to docker. But on command line it fails most of the time. When I try to perfom docker pull hello-world I get the error: Using default tag: latest Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: Get https://auth.docker.io/token?account=p***&scope=repository%3Alibrary%2Fhello-world%3Apull&service=registry.docker.io: unexpected EOF While pulling jugit-registry.fz-juelich.de/docker-images/gitlabci-latex works directly. In the desktop app I am still logged in. I tried to follow the idea with the proxy. But I have no proxy in my setup.

PatrickGoettsch avatar Jun 29 '20 12:06 PatrickGoettsch

I just re-installed Windows 2004 from scratch (before, I did an upgrade, so I thought a fresh install might work). Even when using the getting started image

❯ docker run -dp 80:80 docker/getting-started
Unable to find image 'docker/getting-started:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/docker/getting-started/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Adocker%2Fgetting-started%3Apull&service=registry.docker.io: unexpected EOF.
See 'docker run --help'.

kobelobster avatar Jul 05 '20 07:07 kobelobster

Same issue here, but only when i work directly in ~ When i am in /mnt/m/Sites/MySite the pull works correctly

mortensassi avatar Jul 05 '20 23:07 mortensassi

I checked it on my system. First in a subdir of ~, it gave the same error and also on another HD. It still gives the same error. The docker desktop apllication says that I am logged in but I am not able to login on command line. There I also get an orror with EOF.

PatrickGoettsch avatar Jul 06 '20 06:07 PatrickGoettsch

@PatrickGoettsch For me it was my router and after unchecking a setting it worked: This comment on another issue helped

mortensassi avatar Jul 06 '20 08:07 mortensassi

Thanks. Changing this helped and solved the issue for the moment. But this rises a question wether this problem is related to Docker or to in my case AVM?

PatrickGoettsch avatar Jul 06 '20 09:07 PatrickGoettsch

I would say Docker for Windows OR WSL related. I have a FritzBox as well, but I don't have a problem with pulling docker images on native linux works without any problems. It's just inside WSL 2 it doesn't work. I also think in WSL1 it worked as well without any problems.

Maybe it's also a combination of the two.

kobelobster avatar Jul 06 '20 13:07 kobelobster

@kobelobster which ISP do you use? according to other issues it could be related to Vodafone since all people who where affected were either unitymedia or vodafone customer

mortensassi avatar Jul 07 '20 20:07 mortensassi

@mortensassi I am a Vodafone customer, however, I'm a Vodafone customer as well when working with Linux or using Docker without WSL2 and there it works without any problems. So I fail to see how it can be only related to AVM or Vodafone, if it works with the same components without Windows/WSL2.

kobelobster avatar Jul 08 '20 10:07 kobelobster

I have a similar issue....

If I pull an image or build from an image not cached locally, it just hangs. No error is thrown. However, I am able to pull images if I use sudo.

sgtoj avatar Jul 23 '20 12:07 sgtoj

I have a similar issue....

If I pull an image or build from an image not cached locally, it just hangs. No error is thrown. However, I am able to pull images if I use sudo.

This started happening to me yesterday. But first I had to reset docker to factory defaults because I couldn't start it anymore after a Windows 10 Pro Insider Preview upgrade

jernejg avatar Jul 24 '20 11:07 jernejg

It also started for me.

As a workaround: I pull images in windows, after that they available in wsl2.

laser-me avatar Jul 25 '20 22:07 laser-me

I have a similar issue....

If I pull an image or build from an image not cached locally, it just hangs. No error is thrown. However, I am able to pull images if I use sudo.

same problem here. After i updated the latest insider preview i was getting stuck in pulling images. But i can pull image using windows command prompt. This error is only with wsl2. I cannot say that it is a problem with ISP since i was able to pull image on windows cmd.

rufdev avatar Jul 28 '20 06:07 rufdev

I have a similar issue.... If I pull an image or build from an image not cached locally, it just hangs. No error is thrown. However, I am able to pull images if I use sudo.

same problem here. After i updated the latest insider preview i was getting stuck in pulling images. But i can pull image using windows command prompt. This error is only with wsl2. I cannot say that it is a problem with ISP since i was able to pull image on windows cmd.

fixed by running with sudo

rufdev avatar Jul 28 '20 06:07 rufdev

I had the same problem and also couldn't build, and they were both related an auth issue. see my comment here

If you run docker-compose --verbose pull/build xyz and it gets stuck on auth, this could be your problem. In short: In an elevated powershell echo https://index.docker.io/v1/ | docker-credential-desktop.exe erase

Edit: ...and now it doesn't work. Arg.

Edit: Refer to #7808

patricknazar avatar Jul 28 '20 06:07 patricknazar

Same issue here, was only able to pull images within WSL2 by using sudo, but a regular Command Prompt work without issues:

Microsoft Windows [Version 10.0.20175.1000]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Users\Luis>where docker
C:\ProgramData\DockerDesktop\version-bin\docker
C:\ProgramData\DockerDesktop\version-bin\docker.exe

C:\Users\Luis>docker version
Client: Docker Engine - Community
 Azure integration  0.1.10
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:43:18 2020
 OS/Arch:           windows/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a66213fe
  Built:            Mon Jun 22 15:49:27 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

C:\Users\Luis>docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

C:\Users\Luis>docker pull alpine:latest
latest: Pulling from library/alpine
df20fa9351a1: Pull complete
Digest: sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

C:\Users\Luis>docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
alpine              latest              a24bb4013296        8 weeks ago         5.57MB

Now in WSL2 (Ubuntu-18.04 or Ubuntu-20.04 with Docker Desktop integration):

luis@Nostromo:~$ id
uid=1000(luis) gid=1000(luis) groups=1000(luis),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),117(netdev),1001(docker)

luis@Nostromo:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

luis@Nostromo:~$ which docker
/usr/bin/docker

luis@Nostromo:~$ ll /usr/bin/docker
lrwxrwxrwx 1 root root 48 Jul 28 14:37 /usr/bin/docker -> /mnt/wsl/docker-desktop/cli-tools/usr/bin/docker*

luis@Nostromo:~$ docker version
Client: Docker Engine - Community
 Azure integration  0.1.10
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:45:36 2020
 OS/Arch:           linux/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a66213fe
  Built:            Mon Jun 22 15:49:27 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

luis@Nostromo:~$ docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
alpine              latest              a24bb4013296        8 weeks ago         5.57MB

luis@Nostromo:~$ docker pull alpine:3.11
(sits there, no output)
Ctrl+C

luis@Nostromo:~$ sudo docker pull alpine:3.11
3.11: Pulling from library/alpine
cbdbe7a5bc2a: Pull complete
Digest: sha256:9a839e63dad54c3a6d1834e29692c8492d93f90c59c978c1ed79109ea4fb9a54
Status: Downloaded newer image for alpine:3.11
docker.io/library/alpine:3.11

luis@Nostromo:~$ docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
alpine              latest              a24bb4013296        8 weeks ago         5.57MB
alpine              3.11                f70734b6a266        3 months ago        5.61MB

luislavena avatar Jul 28 '20 12:07 luislavena

Is there any fix for this? I can confirm pulling with sudo works, but I get an error when trying to do the same with docker-compose

ThaDaVos avatar Jul 30 '20 10:07 ThaDaVos

This workaround works for me - https://github.com/docker/for-win/issues/7808#issuecomment-664034094

rikkit avatar Aug 05 '20 17:08 rikkit

Laptop Asus reference this https://github.com/docker/for-win/issues/6622#issuecomment-678891982

SangNguyenTL avatar Aug 24 '20 04:08 SangNguyenTL

Issues go stale after 90 days of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott avatar Nov 22 '20 01:11 docker-robott

Issue still exists - so please no stale...

/remove-lifecycle stale

ThaDaVos avatar Nov 22 '20 13:11 ThaDaVos

/lifecycle frozen

ThaDaVos avatar Nov 22 '20 13:11 ThaDaVos

Observed something similar after upgrading to 4.2.0. This seems to be caused by ~/.docker/config.json, which points back to Windows for the credential store. If Docker Hub is for any reason inaccessible (e.g., is blocked or proxies are needed to access), docker CLI in WSL hangs for a long time (about 5 minutes) before doing anything. Removing ~/.docker/config.json seemed to fix the issue. This should explain why sudo docker pull works without delay, as root user doesn't have the harmful Docker Desktop configuration in its home folder.

EricHripko avatar Nov 26 '21 10:11 EricHripko

Observed something similar after upgrading to 4.2.0. This seems to be caused by ~/.docker/config.json, which points back to Windows for the credential store. If Docker Hub is for any reason inaccessible (e.g., is blocked or proxies are needed to access), docker CLI in WSL hangs for a long time (about 5 minutes) before doing anything. Removing ~/.docker/config.json seemed to fix the issue. This should explain why sudo docker pull works without delay, as root user doesn't have the harmful Docker Desktop configuration in its home folder.

+1

davidiw avatar Apr 04 '22 01:04 davidiw

Had the same issue, solved the same way as https://github.com/docker/for-win/issues/6837#issuecomment-979881643

yutsuo avatar Apr 06 '22 00:04 yutsuo