问题
Problem
Listing the contents of a directory in a shared volume with 200K files from within a ubuntu container hosted in windows gets stuck.
How to reproduce
- Install Docker Desktop 2.2.0.3 (42716) stable on Windows 10
- Configure docker to work in WSL (Ubuntu 16 distribution)
- Expose daemon on
tcp://localhost:2375 without TLS - In WSL, define environment variable
DOCKER_HOST=localhost:2375 - In WSL, in
/etc/wsl.confin the[automount]section, defineroot = /
- Expose daemon on
- Create a folder on the Windows host that contains 200,000 files (even small ones). e.g.
c:/temp - Run a docker container, mapping c:/temp on the host to /opt in the container as follows:
docker run -it -v /c/temp:/opt ubuntu bash - In the bash prompt of the container run
cd /optand thenls
Expected Result
The ls command will start to list all files in the c:/temp folder.
This can be expected to take some time, but it will begin almost immediately.
Actual Result
Nothing is printed and the shell does not respond.
Moreover, CTR C does not interrupt the ls command.
The only way I found to stop the container is to restart Docker Desktop
来源:https://stackoverflow.com/questions/60677656/listing-the-contents-of-a-directory-in-a-shared-volume-with-200k-files-from-with