Weird error under Git bash (MSYS) (solved)

Expected behavior

Same behavior as under cmd shell:
C:\Users…>docker run ubuntu /bin/echo hello world
hello world

Actual behavior

Error under Git bash (MSYS):

$ docker run ubuntu /bin/echo hello world
c:\CloudStation\Programs\dev\Docker\docker.exe: Error response from daemon: Container command ‘C:/Program Files (x86)/Git/bin/echo’ not found or does not exist…


Git bash is the central piece of my development environment, I used a ton of bash aliases & functions to be more productive. Without a solution to this, I’m stuck with either PowerShell or the standard Windows shell, which doesn’t fit in my workflow at all.

In my bash shell, I’m using that version of Docker:
I use the following aliases to execute it:

Folder where I have docker.exe & other utils (docker-compose.exe, etc)


Add that folder to the path

append_to_path $DOCKER_HOME

Aliases for those

alias docker=$DOCKER_HOME/docker.exe
alias docker-machine='docker-machine.exe’
alias dockermachine='docker-machine’
alias dm='docker-machine’
alias docker-compose='docker-compose.exe’
alias dc=‘docker-compose’

Steps to reproduce the behavior

Execute the following command under Git bash (MSYS): docker run ubuntu /bin/echo lol

Actually I’ve just realized that this was a known issue on Docker’s github!

I could fix it by:

  • installing the latest Git version for Windows
  • changing my docker alias (see below)

("$DOCKER_HOME/docker.exe" “$@”)

With the above I get the expected behavior. YAY!

1 Like

Awesome, thanks for following up. If you don’t mind, please post the link to the issue for tracking.