Skip to content

Change attach command for Linux containers from "/bin/sh" to "sh"#159

Closed
FredrikFolkesson wants to merge 1 commit intomicrosoft:masterfrom
FredrikFolkesson:patch-1
Closed

Change attach command for Linux containers from "/bin/sh" to "sh"#159
FredrikFolkesson wants to merge 1 commit intomicrosoft:masterfrom
FredrikFolkesson:patch-1

Conversation

@FredrikFolkesson
Copy link

@FredrikFolkesson FredrikFolkesson commented Oct 27, 2017

This would solve this problem on windows using git-bash:

oci runtime error: exec failed: container_linux.go:295: starting container process caused "exec: \"C:/Program Files/Git/usr/bin/sh\": stat C:/Program Files/Git/usr/bin/sh: no such file or directory"

Which is because git-bash or MinGW is trying to "translate" the "linux path" /bin/sh to the "windows path" C:/Program Files/Git/usr/bin/sh and not understanding that this path will be used inside the linux docker container and not in your windows environment.

//bin/sh would also work since this disables the MinGW "smartness" about paths.

EDIT:
Here are the MinGW Posix path conversion rules
http://www.mingw.org/wiki/Posix_path_conversion

This would solve this problem on windows using git-bash:

`oci runtime error: exec failed: container_linux.go:295: starting container process caused "exec: \"C:/Program Files/Git/usr/bin/sh\": stat C:/Program Files/Git/usr/bin/sh: no such file or directory"`

Which is because `git-bash` or `MinGW` is trying to "translate" the "linux path" `/bin/sh` to the "windows path" `C:/Program Files/Git/usr/bin/sh` and not understanding that this path will be used inside the linux docker container and not in your windows environment.

`//bin/sh` would also work since this disables the `MinGW` "smartness" about paths.
@FredrikFolkesson
Copy link
Author

Closing this for #160

@microsoft microsoft locked and limited conversation to collaborators Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant