1
  • I want to run docker in Git Bash under Windows.
  • If use docker run --rm -ti -v my-vol:/myvol my_volume_test:latest under Cmd/Powershell, all is good.
  • But to use docker under Git Bash, I need to prefix the command with winpty, that's where the problem comes in:
     $ winpty docker run --rm -ti -v my-vol:/myvol my_volume_test:latest
     C:/Program Files/Docker/Docker/resources/bin/docker.exe: Error response from daemon: create my-vol;C: "my-vol;C" 
     includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended
     to pass a host directory, use absolute path.
     See 'C:/Program Files/Docker/Docker/resources/bin/docker.exe run --help'.

I tried to escape the ':' character, but that didn't work either:

$ winpty docker run --rm -ti -v my-vol\:/myvol my_volume_test:latest
C:/Program Files/Docker/Docker/resources/bin/docker.exe: Error response from daemon: create my-vol;C: "my-vol;C" i
ncludes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended
to pass a host directory, use absolute path.
See 'C:/Program Files/Docker/Docker/resources/bin/docker.exe run --help'.
xpt
  • 20,363
  • 37
  • 127
  • 216

0 Answers0