docker: executable file not found in $PATH

后端 未结 10 1072
刺人心
刺人心 2020-11-28 02:02

I have a docker image which installs grunt, but when I try to run it, I get an error:

Error response from daemon: Cannot start container foo_1         


        
10条回答
  •  伪装坚强ぢ
    2020-11-28 02:33

    When you use the exec format for a command (e.g. CMD ["grunt"], a JSON array with double quotes) it will be executed without a shell. This means that most environment variables will not be present.

    If you specify your command as a regular string (e.g. CMD grunt) then the string after CMD will be executed with /bin/sh -c.

    More info on this is available in the CMD section of the Dockerfile reference.

提交回复
热议问题