Boot2docker/Windows: can't run bash on Ubuntu container

前端 未结 3 1416
死守一世寂寞
死守一世寂寞 2021-02-04 18:22

I\'m working through \"The Docker Book\", am on chapter 3, installing and running an Ubuntu container. I\'m on Windows 7.1, using Boot2Docker.

Here\'s what happens when

相关标签:
3条回答
  • 2021-02-04 18:47

    It looks like your host's shell is automatically expanding /bin/bash to C:/Program Files (x86)/Git/bin/bash before it is passed to Docker, which isn't correct as obviously there isn't a C:/Program Files (x86)/Git/bin/bash inside the Ubuntu container.

    Does using quotes fix the problem? For example:

    docker run -i -t ubuntu "/bin/bash"
    
    0 讨论(0)
  • 2021-02-04 18:56

    I've just had the same problem, but

    docker run -t -i ubuntu
    

    opens up a shell inside the image.

    0 讨论(0)
  • 2021-02-04 19:05

    This works for me:

    docker run -t -i ubuntu //bin/bash
    

    The double // avoids the conversion[1]

    [1] http://www.mingw.org/wiki/Posix_path_conversion

    0 讨论(0)
提交回复
热议问题