| name | docker-windows |
| description | Run Docker containers on Windows with MINGW/MSYS2/Git Bash. Prevents path mangling, volume mount failures, and flag conversion issues that silently break Docker commands. |
| triggers | ["docker","container","MOOSE","combined-opt","Docker Desktop"] |
Docker on Windows (MINGW/MSYS2/Git Bash)
The Problem
Running Docker from Git Bash / MINGW on Windows silently breaks commands in three ways:
-
Path mangling: MINGW converts anything that looks like a Unix path to a Windows path.
-w /work becomes -w C:/Program Files/Git/work — Docker gets a nonsensical Windows path.
-
Flag conversion: Single-letter flags like -i (for MOOSE input files) get eaten by MINGW's
path-conversion heuristic when followed by a filename. -i input.i may be silently mangled.
-
Volume mount paths: Forward slashes in volume source paths can trigger path conversion.
-v /c/Users/... may be rewritten to -v C:/Program Files/Git/c/Users/....
These failures are silent — Docker may start, mount an empty volume, or pass garbled flags, and
the command appears to "work" while producing no output or wrong results.
The Solution
Always prefix Docker commands with MSYS_NO_PATHCONV=1 to disable all MINGW path conversion.
Canonical Docker Run Pattern
MSYS_NO_PATHCONV=1 docker run --rm \
-v \
-w /container/mount/subdir \
--entrypoint /bin/bash \
IMAGE_NAME:TAG \
-c