Why does Docker say it can't execute 'bash"?

前端 未结 1 1652
南笙
南笙 2021-01-30 16:12

I\'m using Docker on MacOSX (with Boot2Docker).

I can run images from Docker Hub.

However, when I try to run one of my own images like this:

dock         


        
相关标签:
1条回答
  • 2021-01-30 16:40

    Your image is based on busybox, which doesn't have a bash shell. It does have a shell at /bin/sh.

    So this doesn't work:

    $ docker run -it busybox bash
    exec: "bash": executable file not found in $PATH2015/01/15 11:09:08 Error response from daemon: 
    Cannot start container a5074af2f81f8cc1eb0076f4ec9ada5f87be1440006f54a9b06ab701fc60176a: exec:  
    "bash": executable file not found in $PATH
    

    But this does:

    $ docker run -it busybox /bin/sh
    / #
    

    There may be further complications due to your entrypoint script, but you can always override that.

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