-
Notifications
You must be signed in to change notification settings - Fork 289
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
Mounts stop receiving inotify change events from Windows host #8479
Comments
Thanks for the report, @8ctopus. Are you running Docker in WSL 2, but keeping your files in the Windows file system instead of the Linux file system? If so, then this is expected (and documented, and out of our control because we don't manage the file sharing in that scenario). |
@stephen-turner Thank you so much for your reply, I've been trying to figure out where the problem comes from for 4-5 hours. I've just disabled WSL 2 and everything works again as it should. It's unfortunate that the better WSL 2 breaks that functionality and I had to revert to Hyper-V. |
The alternative is to use WSL 2 but keep your files on the Linux side. That's what we recommend for best performance. |
@stephen-turner Thank you again, I'll try that. I'm completely new to WSL 2 so don't have any experience with it yet. |
@stephen-turner What exactly do you mean by "keep files on the linux side?" (I'm to much of a Linux person). To physically move the files into the wsl2 Ubuntu VM? I thought that if you use for example I'm having issues getting my "old" Hyper-V mounts to work as well after upgrading to wsl2 and I'm not sure why? When looking at the paths it all seems OK: That's from a compose that looks like this:
|
Yes keep your files in the WSL 2 filesystem. Don't share them across the VM boundary because it's unperformant and you lose inotify. |
@stephen-turner I have no problem doing that in cases where the files may be small, such as simple config files, but what about in cases like for example, Nextcloud, where the binded mounts can be terabytes? (I use an external 2tb drive bind mounted to that container). I don't understand why using /mnt/ isn't working at all? Do bind mounted paths still need to be "shared" in linux, the way they did using the Docker GUI for Hyper-V? if so, how does one "share" paths in Linux? Update:
or
it shows the error:
|
|
Thanks @stephen-turner
So in order to use Nextcloud, or other containers that need lots of storage space, like torrent clients, NZB clients, etc. we have to stick with the Hyper-V version and lose out on all the WSL2 benefits? :/
Hmmm, I think you're onto something, but I don't have enough experience to know what, lol. When I do:
It works, but using this in compose (I use Portainer), I get the error shown above:
Any ideas? I'm left scratching my head here, lol. |
|
@stephen-turner Question: when using WSL2 but keeping the files in Windows. is the performance worse than using Hyper-V with the files in Windows? |
In our experiments it is worse, yes. Exactly how much worse depends on the nature of your workload: it can be anything from a few percent to multiples. The biggest penalty is when you have frequent accesses to lots of small files. Living wholly within the WSL 2 world is always fastest, if you can achieve that. |
btw inotify events have never worked for files stored on filesystems that come from a VMs "shared folder strategy" (it's essentially coming into your vm via Samba). You've always had to enable some kind of polling solution like |
Does anyone have a release version where this was working? It worked for us for a long while. You could save me sometime :). Turns out I was able to answer my own question: 2.2.0.5 (in case someone was interested) |
I'm attaching the WSL2 issue to the thread [WSL2] File changes made by Windows apps on Windows filesystem don't trigger notifications for Linux apps |
In case someone stumbles over this problem as well and isn't quite sure how to set up the dev environment with VS Code, WSL2, Docker Desktop, a dev container and a mounted directory with the cloned repo (i.e. source code), then here is an article that describes the root cause and also how to avoid it by keeping all files in the Linux file system. I researched and wrote the article over the last few weekends and hope it'll help save you some time or at least provides some additional insights into what is happening. "Docker Desktop on WSL2: The Problem with Mixing File Systems" |
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. |
[x] I have tried with the latest version of my channel (Stable or Edge): tested under edge 2.3.6 47622 and stable 2.3.0.4 46911
[x] I have uploaded Diagnostics
Diagnostics ID: F6FACDFC-D90A-40E8-8A1A-FC5A6D749036/20200915092839
Windows Version: Microsoft Windows 10 Pro 2004 19041.508
Docker Desktop Version: edge 2.3.6 47622 and stable 2.3.0.4 46911
Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: No
Expected behavior
File change events from editing in the host should propagate to the container to enable tools like modd, nodemon or webpack to re-compile files in-container.
Actual behavior
Event triggered when changes happen within the container but not when on host. The problem existed in the past #5701 but seems to have reappeared in the latest Docker for Windows versions.
Steps to reproduce the behavior
docker-compose.yml
Using git-bash shell on Windows
The text was updated successfully, but these errors were encountered: