WSL: Docker **Client** Hang on Windows Subsystem for Linux (WSL)

NOTE: This is a problem with running the docker CLIENT inside of WSL. This is NOT a problem with running the docker daemon inside WSL which I recognize should not be expected to work at all.

A brief description

After downloading the docker client in WSL I am able to run most commands (run, ps, images, rm, etc.). However, when I try to do a docker build it hangs while copying the context.

Expected results

I expected it to build my image.

Actual results (with terminal output if applicable)

$ ~/docker/docker -H tcp://0.0.0.0:2375 build .
Sending build context to Docker daemon 12.81 MB

It sits here indefinitely. I once let it sit for a while (not sure how long, maybe 30-60 minutes) and it never moved on. The number of MB it gets to before failing varies slightly each time, though it is usually within a few MB of 12MB. When running docker client in windows, it indicates a 53MB context.

Your Windows build number

Windows 10 Enterprise N with latest patch.

Steps / All commands required to reproduce the error from a brand new installation

  1. Install Windows 10.
  2. Install Docker for Windows.
  3. Install Windows Subsystem for Linux.
  4. Open a bash prompt.
  5. cd ~
  6. wget https://get.docker.com/builds/Linux/x86_64/docker-1.13.0.tgz
  7. tar -xzvf docker-1.12.1.tgz
  8. echo FROM alpine:latest > Dockerfile
  9. dd if=/dev/urandom of=file.txt bs=1048576 count=20
  10. ~/docker/docker -H tcp://0.0.0.0:2375 build .
  11. Wait indefinitely.

Related docker issue (unclear whether the problem is Docker or WSL): https://github.com/docker/docker/issues/26889

Additional Notes

The problem appears to only occur with large contexts (over 12MB). With a trivially small context everything works. Some details on the exact failure can be found in this comment: https://github.com/docker/docker/issues/26889#issuecomment-249449999

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 8
  • Comments: 36 (16 by maintainers)

Most upvoted comments

@MicahZoltu Well, besides using apt-get install docker.io instead of downloading docker in a tarball, I just followed your instructions to a T. It worked.

I even went a bit further and copied the 21MB file into the image being built and I was able to build it exactly the same way in about 3 seconds.

I cannot reproduce this on 15007. WSL is actively being worked on in the insider builds and does do as expected in this scenario.

@MicahZoltu - In general, yes, unless the bugfix is for a critical security issue or a major blocker. In which case we try to backport the fix to the last Windows full release.

@MicahZoltu – WSL updates are (for the most part) only available in Insider builds right now. You’re correct, as I understand it, that this means that they will be available in a future stable release.