Can we control case sensitivity of contents in .dockerignore file? Can we control case sensitivity of contents in .dockerignore file? docker docker

Can we control case sensitivity of contents in .dockerignore file?


It seems like the .dockerignore file is case-insensitive on Windows and case-sensitive on Linux (and thus likely MacOS).

From the Docker documentation:

The CLI interprets the .dockerignore file as a newline-separated list of patterns similar to the file globs of Unix shells. [...] Matching is done using Go’s filepath.Match rules. A preprocessing step removes leading and trailing whitespace and eliminates . and .. elements using Go’s filepath.Clean.

It seems like aforementioned functions make use of Go's glob, which is case-insensitive or case-sensitive depending on your operating system


It's Monday 20 Sept 2021 and .dockerignore files appear to be case-sensitive on Windows. I had to change one of my exclusion rules from!obj\Docker\program*to!obj\Docker\Program*

I'm using VS 2019 (version 16.11.3) along with VS Tools for Containers 1.0 and VS Container Tools Extensions 1.0.