We are using Docker Desktop on Windows for our development environment. Here’s a command that was working until the last update 4.6.1 (76265)
We run a git bash script to set up a number of variables based on the target environment.
I am simplifying somewhat to illustrate the problem.
docker run -v $dockerLogLocation/baseline:/tomcat/logs:z $dockerRepo/sxnimbus/baseline:$TAG
$1 is the name of the application
$dockerLogLocation is /c/Users/ravis1/git/docker/logs
$dockerRepo varies by environment
$TAG in this case is ‘local’ as it is a local build
when I run this command, it creates a baseline;C directory in the logs folder
When I originally wrote this it worked fine on my machine. When my team started trying it they were seeing the directories, and log files were not appearing in either logs/baseline or logs/baseline:C
Since I upgraded to this version I see the same problem. Is there a workaround, or a fix in the works?
I tried on Windows with the same version (4.6.1) from Git Bash. First I didn’t notice any error. Then I tried to inspect the container and saw the destination folder was wrong. It was prefixed with the EXEPATH environment variable. Since I have never used Docker from Git Bsh before, I don’t know what is the normal behavior, but it doesnt’t seem right to me either. This is probably related to the fact that git bash refers to the Windows path as it were on Linux and Docker needs to convert it similarly to what happens on WSL2. I don’t know if Git Bash is officially supported or not by Docker, but if you use the WSL2 backend for Docker Desktop, you should try “Enable WSL2 integration” from the Docker Desktop settings and use bash from your default WSL distro or you can even use other distros as well.
I have WSL2 turned on already. The shell script on git bash was working until the latest version, so it really surprised me when these failures started happening.
I tried running from the windows shell (i.e. DOS for us old folks) and it works as expected, so for now I’ll have to create a .bat file to use for local development.
I still need the shell script as our target environment is linux, and it works there as expected.
I hope someone from docker sees this thread and puts the found bug in their ‘to do’ backlog.
It could happen, but if you really think it is a bug or something that Docker should support, you should submit an issue on GitHub: Docker for Windows issues
Before you do that, try to search for an existing issue.