microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.46k stars 821 forks source link

WSL2 Docker Build Hangs on downloading for a long time #12270

Open ismailbayram opened 2 days ago

ismailbayram commented 2 days ago

Windows Version

Microsoft Windows [Version 10.0.22631.4317]

WSL Version

2.3.24.0

Are you using WSL 1 or WSL 2?

Kernel Version

No response

Distro Version

Ubuntu 24.04

Other Software

No response

Repro Steps

I don't know, it happened suddenly.

Expected Behavior

I hope it should download and build the image under a minute like it used to be!

Actual Behavior

WSL2 Docker Build hangs on downloading anything for a long time. Image

Diagnostic Logs

No response

github-actions[bot] commented 2 days ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The script will output the path of the log file once done. If this is a networking issue, please use [collect-networking-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1), following the instructions [here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues) Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

zcobol commented 4 hours ago

@ismailbayram please check your docker networking. Looks like it's not working 😀

I did a quick test using Docker version 27.3.1, build ce12230 running inside WSL Ubuntu 24.04.1 and the build finishes in seconds. All the packages are pulled in.

Dockerfile used for testing, running your failed command:

FROM alpine:latest
RUN apk update && apk add libpq-dev postgresql-dev gcc python3-dev musl-dev gettext
CMD ["/bin/ash"]

and docker build output:

[+] Building 9.3s (6/6) FINISHED                                                                                           docker:default
 => [internal] load build definition from Dockerfile                                                                                 0.0s
 => => transferring dockerfile: 157B                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                                                     0.7s
 => [internal] load .dockerignore                                                                                                    0.0s
 => => transferring context: 2B                                                                                                      0.0s
 => CACHED [1/2] FROM docker.io/library/alpine:latest@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a        0.0s
 => [2/2] RUN apk update && apk add libpq-dev postgresql-dev gcc python3-dev musl-dev gettext                                        7.1s
 => exporting to image                                                                                                               1.4s
 => => exporting layers                                                                                                              1.4s
 => => writing image sha256:1899886259178f5f17e0f69f0224e72ad12119af330225b807572712749808d9                                         0.0s