-
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
Docker version 2.0.0.0+ loses case sensitivity for filenames via volumes #5894
Comments
I confirm that on 2.2.0.3, you get an "input/output error". However, the behaviour on old versions is not as you describe ("the mount would be case sensitive allowing both upper case file names and lower case as separate files"). As the mounted volume is actually a Windows filesystem underneath, it is case insensitive, and we can't change that. In my experiments on old versions, "test" and "Test" are the same file, and you can address it under either name, which is also unexpected when you're in the Linux container. I'm not sure which is better, to have a case insensitive file system on Linux, which could lead to subtle bugs, or to give an error? |
Looks like it's possible now to enable case-sensitive directories on Windows; https://www.howtogeek.com/354220/how-to-enable-case-sensitive-folders-on-windows-10/ |
Right, but I don't think Docker Desktop should forcibly do that, it would have to be something the user did for themselves. |
Ah, sorry for my brevity; I was wondering; if the host location (windows) that's being bind-mounted is case-sensitive; does docker desktop respect that configuration? (so would |
Thank you for the replies gents,
sorry yes, you appear to be right:
Would using WSL resolve this? as WSL seems to support case sensitivity. Might be just a case of using the old version until WSL is stable. WSL:
This issues does break rails development rather badly. As sprockets creates cache files and they end up clashing,. Before when no error was thrown things were okay, but now with the error happening rails breaks pretty badly. |
Do you need those cache files on your host machine? If not, you could use a (named) volume for that path, instead of a bind-mount. |
Looks like setting the directory to be case-sensitive; rails/sprockets#283 (comment) or using a named volume rails/sprockets#283 (comment) are solutions used by others |
thanks for those! I tried both of those solutions and neither were particularly good. The first one requires the fsutil and I had the same issue the guy posts below the one you point out. The second one I had troubles getting to work and feels like a bit of a hack to modify rails default behaviour. Also, ends up being a chunk I then need to alter every project I have to use. Where as before it worked on 18 without issue. With the bind mount are you saying the I can bind sub-folder differently. For example /app could mount to the hosts c:\projects\test\ folder and use a name volume for /app/tmp that might be ideal as i really don't care about what goes on in the tmp folder. |
Yes, that should work, so docker run -it --rm -v <host-path>:/app -v mycachevolume:/app/tmp <my container> Or in a compose file; version: "3.7"
services:
app:
image: myimage:latest
volumes:
- ./:/app
- appcache:/app/tmp
volumes:
appcache: (If your local directory does not have a |
Thank you that indeed works. I wasn't aware you could map sub folders of another volume like that. |
It's not "ideal" to nest mounts (and I think there have been some bugs/race-conditions about mount order in the past), but it should work, and using a named volume for caches should be more performant as well, because Docker Desktop doesn't have to sync those files back to the host filesystem (which can be a bottleneck if there's many files that are changing often). |
Great, thank you for that tip and for taking the time to help me out. Much appreciated and keep up the great work with Docker! |
The fix for the original bug in this issue is now released in 2.2.0.4. |
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. |
Expected behavior
On a mount to the host be able to create files in a case sensitive environment. Being able to create files both names "test" and "Test" in a mounted folder and have them treated as separate files. As it worked on 18.06.1
Actual behavior
When mounting a volume on windows in docker 18.06.1-ce-win73 2018-08-29 the mount would be case sensitive allowing both upper case file names and lower case as separate files.
On Docker 2.0.0.0+ I get an error:
Information
Steps to reproduce the behavior
Install docker 2.0.0.0 on windows and use the following files, the go into the app container and cd into /app/tmp and run the commands above.
My docker compose:
Docker File
The text was updated successfully, but these errors were encountered: