New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute paths change with git bash on windows #24029

Closed
kriku opened this Issue Jun 28, 2016 · 5 comments

Comments

Projects
None yet
5 participants
@kriku

kriku commented Jun 28, 2016

docker run -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done"

using from git bash on win10 cause

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: 
Error response from daemon: 
oci runtime error: 
exec: "C:/Program Files/Git/usr/bin/sh": 
stat C:/Program Files/Git/usr/bin/sh: no such file or directory.

and docker ps -a returns

CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS               NAMES
82be3202167b        ubuntu              "C:/Program Files/Git"   About a minute ago   Created                                 jovial_engelbart

seems like git bash change all dirs from root to local one, related to git bash installation

exec this command from power shell works well

@kriku

This comment has been minimized.

Show comment
Hide comment
@kriku

kriku Jun 28, 2016

also it change dir when adding a data volume

docker run -d -P --name web -v /webapp training/webapp python app.py
"Mounts": [
    {
        "Name": "945c5b0f0e3b140dad75b0de9850f504c37ef8472c94bd69550bc89af4210914",
        "Source": "/var/lib/docker/volumes/945c5b0f0e3b140dad75b0de9850f504c37ef8472c94bd69550bc89af4210914/_data",
        "Destination": "C:/Program Files/Git/webapp",
        "Driver": "local",
        "Mode": "",
        "RW": true,
        "Propagation": ""
    }
],

running this command in power shell works fine

find similar issue on stack overflow

shell is mangling the file name according to these rules

kriku commented Jun 28, 2016

also it change dir when adding a data volume

docker run -d -P --name web -v /webapp training/webapp python app.py
"Mounts": [
    {
        "Name": "945c5b0f0e3b140dad75b0de9850f504c37ef8472c94bd69550bc89af4210914",
        "Source": "/var/lib/docker/volumes/945c5b0f0e3b140dad75b0de9850f504c37ef8472c94bd69550bc89af4210914/_data",
        "Destination": "C:/Program Files/Git/webapp",
        "Driver": "local",
        "Mode": "",
        "RW": true,
        "Propagation": ""
    }
],

running this command in power shell works fine

find similar issue on stack overflow

shell is mangling the file name according to these rules

@kriku kriku changed the title from Hello world in a container example cause oci runtime error to Absolute paths change with git bash on windows Jun 28, 2016

@kriku kriku closed this Jun 28, 2016

@xandermar

This comment has been minimized.

Show comment
Hide comment
@xandermar

xandermar Sep 8, 2016

+1

$ winpty docker run -it -p 8065:80 -p 2262:22 drupal:7.50 /bin/bash
docker: Error response from daemon: oci runtime error: exec: "C:/Program Files/Git/usr/bin/bash": stat C:/Program Files/Git/usr/bin/bash: no such file or directory.

$ docker version
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: windows/amd64

Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: linux/amd64

COMMAND
"C:/Program Files/Git"

... on Windows 10 Pro

xandermar commented Sep 8, 2016

+1

$ winpty docker run -it -p 8065:80 -p 2262:22 drupal:7.50 /bin/bash
docker: Error response from daemon: oci runtime error: exec: "C:/Program Files/Git/usr/bin/bash": stat C:/Program Files/Git/usr/bin/bash: no such file or directory.

$ docker version
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: windows/amd64

Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 21:15:28 2016
OS/Arch: linux/amd64

COMMAND
"C:/Program Files/Git"

... on Windows 10 Pro

@caylorme

This comment has been minimized.

Show comment
Hide comment
@caylorme

caylorme Sep 29, 2016

Getting the same error on Windows 10 Right now.

me@my-pc MINGW64 /z
$ docker run -it ubuntu /bin/bash
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: oci runtime error: exec: "C:/Program Files/Git/usr/bin/bash": stat C:/Program Files/Git/usr/bin/bash: no such file or directory.

$ docker info
Containers: 23
 Running: 0
 Paused: 0
 Stopped: 23
Images: 18
Server Version: 1.12.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 67
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null bridge overlay host
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.20-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.942 GiB
Name: moby
ID: WKOX:HURI:52OJ:XGQG:3XP5:4VQ3:DPRC:RHEA:HNX5:UU2X:JTKM:42DT
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 14
 Goroutines: 23
 System Time: 2016-09-29T04:15:05.3298145Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

Works fine when using the normal Windows command prompt, just not with Git-Bash

caylorme commented Sep 29, 2016

Getting the same error on Windows 10 Right now.

me@my-pc MINGW64 /z
$ docker run -it ubuntu /bin/bash
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: oci runtime error: exec: "C:/Program Files/Git/usr/bin/bash": stat C:/Program Files/Git/usr/bin/bash: no such file or directory.

$ docker info
Containers: 23
 Running: 0
 Paused: 0
 Stopped: 23
Images: 18
Server Version: 1.12.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 67
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null bridge overlay host
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.20-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.942 GiB
Name: moby
ID: WKOX:HURI:52OJ:XGQG:3XP5:4VQ3:DPRC:RHEA:HNX5:UU2X:JTKM:42DT
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 14
 Goroutines: 23
 System Time: 2016-09-29T04:15:05.3298145Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

Works fine when using the normal Windows command prompt, just not with Git-Bash

@thaJeztah

This comment has been minimized.

Show comment
Hide comment
@thaJeztah

thaJeztah Sep 29, 2016

Member

Yes, that's mingw trying to be smart, and converting paths. It's not a bug in Docker, but the way mingw handles these paths. Here is some more information about that "feature"; http://www.mingw.org/wiki/Posix_path_conversion. Prefixing the path with a double slash (//bin/bash) should prevent this, or you can set MSYS_NO_PATHCONV=1, see http://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line#34386471

(but I'm not on Windows myself, so cannot check).

Member

thaJeztah commented Sep 29, 2016

Yes, that's mingw trying to be smart, and converting paths. It's not a bug in Docker, but the way mingw handles these paths. Here is some more information about that "feature"; http://www.mingw.org/wiki/Posix_path_conversion. Prefixing the path with a double slash (//bin/bash) should prevent this, or you can set MSYS_NO_PATHCONV=1, see http://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line#34386471

(but I'm not on Windows myself, so cannot check).

@anderejd

This comment has been minimized.

Show comment
Hide comment
@anderejd

anderejd Jan 4, 2018

Posted a workaround here: docker/toolbox#673

anderejd commented Jan 4, 2018

Posted a workaround here: docker/toolbox#673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment