First, try passing a command to your sh shell:
docker-compose run --rm web sh -c "/data/bin/install_test_db.sh"
Or:
docker-compose run --rm web "sh -c /data/bin/install_test_db.sh"
That will avoid your host shell (the git bash) to interpret an absolute path (starting with '/
') as one from the Git installation path.
That will keep /data/...
as an argument to be passed to the shell executed in the container.
Note: If you are using Docker for Windows (meaning not VirtualBox, but HyperV), you don't need git bash
at all.
Try the same command from a regular CMD (with docker.exe
in your %PATH%
, which Docker for Windows set for you)
vonc@VONCAVN7 C:\Users\vonc
> where docker
C:\Program Files\Docker\Docker\Resources\bin\docker.exe
If you need Linux-like commands from that same CMD session, then yes, add git paths:
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%