-
Notifications
You must be signed in to change notification settings - Fork 287
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
Docker on Windows is not usable with volumes mapped to local directories #394
Comments
Hi @denisvmedia, could you try with latest beta ? |
@denisvmedia I am not experimenting such behavior and I am working with Symfony, maybe I misunderstood the issue. Anyway this is my repository give it a try and let me know if you still experimenting the same issue. I am using the latest beta - a RC I think? |
My research shows that I "reynierpm/docker-centos7-supervisord:latest" image (used in Dockerfile by @reypm) has no problems with deleting the files and folders but "alpine:edge" (which is used by my container) has this problem. I went further. I took my huge cache folder and put it to d:\data\dev. I ran two commands over it (both times I restored the folder of course). First test using alpine:latest image:
Second test using reynierpm/docker-centos7:latest image:
How come it works with one image and doesn't work the the other? |
Here is another example that works. So, seems there is an issue only with
|
@denisvmedia can you share your Dockerfile? |
@reypm it happens even without Dockerfile... This command |
However, the problem with the files is gone, still the productivity is bad... The app loading too slow. And I don't know how to prove that (as I'm not allowed to share the sources). It takes 13 seconds to load the app. And assets in dev-mode are being loaded forever :( On the same PC without Docker it works fast. If anyone knows an open source Symfony app with reach functionality that I could test in Docker, I could prepare a proof of the problem. |
This issue also occurs on my environment, mainly when compiling programs on a shared volume. Here is an example to recreate. [claus@windows]$ mkdir test2
[claus@windows]$ docker run -it --rm -v $(pwd)/test2:/test2 centos:7 bash
[root@7c4e4f8ab238 /]# yum -y install bzip2
... yada yada...
[root@7c4e4f8ab238 /]# cd test2
[root@7c4e4f8ab238 /]# curl -O "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.3.tar.bz2"
[root@7c4e4f8ab238 test2]# while true; do tar xf alsa-lib-1.1.3.tar.bz2 && rm -rf alsa-lib-1.1.3 && echo -n "."; done
................^C
[root@7c4e4f8ab238 test2]# while true; do tar xf alsa-lib-1.1.3.tar.bz2 && rm -rf alsa-lib-1.1.3 && echo -n "."; done
rm: cannot remove 'alsa-lib-1.1.3': Directory not empty
tar: alsa-lib-1.1.3/alsalisp: Cannot mkdir: No such file or directory
tar: alsa-lib-1.1.3/alsalisp: Cannot mkdir: No such file or directory
tar: alsa-lib-1.1.3/alsalisp/alsalisp.c: Cannot open: No such file or directory
tar: alsa-lib-1.1.3/alsalisp: Cannot mkdir: No such file or directory
tar: alsa-lib-1.1.3/alsalisp/Makefile.in: Cannot open: No such file or directory
tar: alsa-lib-1.1.3/alsalisp: Cannot mkdir: No such file or directory
tar: alsa-lib-1.1.3/alsalisp/Makefile.am: Cannot open: No such file or directory
^C
[root@7c4e4f8ab238 test2]# The workaround so far has been for me to always use unshared volumes, the container's filesystem, or --tmpfs instead of shared volumes. However, it can be pretty annoying to have "rsync -a /volume/ /tmp/volume" in a build script. I'm using version 17.03.0-ce-win1 (10296) Channel: stable e5a07a1, however this occurred on all past versions I have tried so far. |
This has been driving me insane all day. I'm seeing it on the node:7 image, which is based off jessie - so not strictly an Apline issue I think. |
Same issue. I can't use webpack to recompile and version assets because it always complains about deleting a file that doesn't exist. The file shows up inside the image and on the windows host but won't actually complete deleting until I stop the container. |
Same issue here with windows + php-fpm + nette framework which is doing caching - fairly similar to symfony caching. |
Still happening on version 17.03.1-ce-win5 b18e2a5. Also, I don't know if this is related: Sometimes, single files fail to be removed. Sometimes, I/O stops working completely after a few minutes of being idle:
|
It really works bad. I was trying to install Jenkins with mapping and was observing random Jenkins's plugins errors and either "yarn install" or "npm install" worked incorrectly. They cannot install all packages inside a volume Docker version 17.03.1-ce, build c6d412e |
Are there any plans to fix this ? (happens also with 17.06.0-ce-win18 (12627) ) |
+1. It's so slow. Running |
Similar issue (stale file handles) trying to build with make from within Docker container on a mapped directory. Only when using parallel builds (-j), serial fine. |
I have nginx/php-fpm in a container, and 2 copies of the same Symfony project:
|
Setup a docker with shared volume. php7.0-fpm with nginx, having magento. Loads way too slow. |
make -j is slow to the point of being useless inside docker-for-windows. It was fine in the previous version. When I look at the Task Manager, the shared drive utilization is at 100% !! Only after I exit the docker, it goes down. |
Are the any plans to fix the problem? |
@denisvmedia Try removing the Docker-for-Windows, and all the containers, then reinstalling it. It made it a little better for me. Do not re-use the previous images. |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an 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. |
/remove-lifecycle stale |
A workaround instead rebooting Windows/Docker would be:
|
Please look into this issue. This has become a near daily occurrence while using Docker for Windows. |
The workaround only deals with the stale file handle issue. I rarely get the stale file handle issue, the failure to delete issue happens all the time when running anything that quickly deletes and adds new files (i.e. composer, npm, etc.) and requires that you either have to clean the folder yourself manually in windows or run the program repeatedly until it succeeds (neither are great solutions). The main issue appears to just be file system performance. As mentioned before performance is at least 15x slower than native windows. |
I am having similar issues when using |
Such a shame that no one adresses this. We have an enterprise application which is consisting of 12 mini apps. Every time we run another one in parallel, seems to become exponentially slower. For the 5th app, it took 1 min 20 seconds to sync everything inside node modules. Thats why there are so few devs on Win. |
This annoying shit should be fixed ASAP, Symfony dev here - working on windows docker even with hyper-v is nightmare, but i'm to lazy to migrate to unix 🐧 |
See if you can use WSL - it's proving to be much better for me than Docker for Windows. |
I have a script that tries to rm -rf a git repo inside a container; it always fails on Docker for Windows. |
Is it so cumbersome to modify every file? |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an 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. |
/remove-lifecycle stale Still struggling with this on an everyday basis |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an 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. |
/remove-lifecycle stale |
I have been experimenting this issue a lot with the latest stable builds (2.3.0.2, 2.3.0.3) I don't really understand what is happening but this is a very-hard-to-live-with issue :( |
FYI: This is a non-issue with WSL2. I highly recommend upgrading to Windows 10 2004 release, switching to WSL2 and using Docker's WSL2 integration. Anything with file system intensive operations, composer, npm, etc. are all much faster and actually finish without error. |
WSL2 is not a perfect fix. As described in the Best Practices section of the docs you must put your code inside the WSL VM if you want changes to the files to be detected. This makes working with your favorite IDE or other Windows tools more complicated. More info:
|
True, it is not completely without issue, but it does resolve this one completely, which was our biggest pain point. We have had far fewer issues with our dev ops process with WSL2. The VS Code integration is pretty great as well and the file sharing between Windows and WSL2 works well enough for the windows tools we use and has significantly sped up our development process. |
Before January 2020In the past, watching for changes in mapped volumes required your apps polling for file changes from the Docker container. Many Node.js libraries came with a WSL2Now with WSL2, native file-watching is gone again. I have to poll files again to see changes. It's a huge step backward. WSL2 is the recommended method of using Docker in Windows, but that doesn't make sense unless you're specifically using VS Code. Now, I could go back to polling like in the past, but then I'd opt out of using Docker altogether as that costs my projects time. For everyone who doesn't use VS Code, if the Docker build is broken or you need to make changes before starting the container, that requires editing the project's files on your host OS's drive. But then when developing with hot-reload or some other file-watching technology, you'll need to start the project, setup your text editor to view project files from inside the Docker container, and then file-watching works again. Is it on the roadmap for WSL2 Docker to allow for native Windows file-watching without having to edit files in the Docker container? |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an 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. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
@Sawtaytoes I only just saw your comment. In the case of WSL 2, Windows manages the file sharing from the Windows filesystem into the Linux environment, not us, so it is Microsoft who would have to add inotify support. That's one reason why we recommend keeping your files in the Linux filesystem: https://docs.docker.com/docker-for-windows/wsl/#best-practices. Actually, I think they have some tickets already. https://github.com/microsoft/WSL/search?q=inotify&type=issues would be a good starting place. |
Expected behavior
Remote operations should work as if the directories are local to the container
Actual behavior
There are multiple problems:
Information
Steps to reproduce the behavior
Misc
Until it's solved, Docker is completely unusable for me on Windows (and I don't get how people use it - probably it's ok for really small microservice applications, but for something bigger it's just failing to work properly).
The text was updated successfully, but these errors were encountered: