On OSX and Windows, as you might know, directories are case insensitive. So the directory CaseSensitive and casesensitive are the same on those operating systems. But on Linux, they are different directories.

The interesting thing about this is, that when you use docker and attach a volume to the container from OSX or Windows, that directory will be case insensitive. While other directories within the container are case sensitive (because it runs Linux). Which makes perfect sense, as the directory in the volume is managed by your own OS.

A small demonstration:

~ > ls blog/CaseSensitiveTest/
somefile
~ > docker run -it -v (pwd)/blog:/blog alpine /bin/sh
/ # ls blog/CaseSensitiveTest
somefile
/ # mkdir -p test/CaseSensitiveTest
/ # touch test/CaseSensitiveTest/someotherfile
/ # ls test/CaseSensitiveTest
someotherfile
/ # ls test/casesensitivetest
ls: test/casesensitivetest: No such file or directory
/ # ls blog/casesensitivetest
somefile
/ #

So on my own machine I have a directory blog/CaseSensitiveTest with a file somefile. When I run an alpine container, and attach it as a volume, you can see its contents. Next I create a directory test/CaseSensitiveTest with the file someotherfile. Then I try to list its contents using the different names: CaseSensitiveTest works, and casesensitivetest doesn’t work.

But if I try to list the contents of the volume, using casesensitivetest, it works! So this is something to keep in mind when working with Docker, would have saved me a lot of time when debugging.

shadow-left