Search code examples
dockerboot2docker

boot2docker equivalent of docker exec


First time dorking with Docker and Go, and I'm unfamiliar with linux commands, so I could be mucking up in any aspect of this: I'm running boot2docker on a windows machine and I'm trying to get inside a running instance to debug why my Go isn't executing. Using docker exec containerId /bin/bash returns:

$ docker exec 1755 /bin/bash
exec: "C:/Program Files (x86)/Git/bin/bash": stat C:/Program Files (x86)/Git/bin/bash: no such file or directory
Cannot run exec command 0368f06b90454cf3f8bb0b29f0cacb66503907f6c7fb806c09e97f83
fef8c48b in container 17557fbf39f4419d509c58563a1ba17d6d269d91395b76ea4266c1898e
8665cf: [8] System error: exec: "C:/Program Files (x86)/Git/bin/bash": stat C:/Program Files (x86)/Git/bin/bash: no such file or directory
Error starting exec command in container 0368f06b90454cf3f8bb0b29f0cacb66503907f
6c7fb806c09e97f83fef8c48b: Cannot run exec command 0368f06b90454cf3f8bb0b29f0cac
b66503907f6c7fb806c09e97f83fef8c48b in container 17557fbf39f4419d509c58563a1ba17
d6d269d91395b76ea4266c1898e8665cf: [8] System error: exec: "C:/Program Files (x86)/Git/bin/bash": stat C:/Program Files (x86)/Git/bin/bash: no such file or directory

Which is obviously not right. What's with the chain of containers, boot2docker itself then the one I entered? I'm seeing alternatives like nsenter, but those claim that docker exec renders them obsolete. What's the catch with Windows/Boot2Docker?

A comprehensive explanation with the answer would be lovely.


Solution

  • Try with the double slash // instead, like this:

    docker exec -it <container-id> //bin/bash

    source: http://www.mingw.org/wiki/Posix_path_conversion Also mentioned here: https://stackoverflow.com/a/30184356/2167517