Docker容器命令找不到shell脚本

这是我的Dockerfile:

FROM debian MAINTAINER Andrew Ford<andrew.ford@gg.com> RUN apt-get update COPY entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] 

这里是我的entrypoint.sh(与Dockerfile相同的目录)

 #!/bin/bash echo Hello 

然后我跑了:

 docker build --no-cache=true -t test/dockerfile-sayhello . 

当我跑时:

 docker run test/dockerfile-sayhello 

它返回:

 C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: Container command '/entrypoint.sh' not found or does not exist.. 

我曾试着用Googlesearch来看看我是否犯了明显的错误,但到目前为止我还没有find它。 也许你们中的一些人可以帮忙

编辑:也运行chmod + x的entrypoint.sh给予权限

我只是试着用下面的Dockerfile(添加chmod

 FROM debian MAINTAINER Andrew Ford<andrew.ford@gg.com> RUN apt-get update COPY entrypoint.sh / RUN chmod 755 /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] 

它按预期工作。


这不是问题20789 :

我试图将一个Dockerfile设置从phusion / baseimage转换为gliderslabs / alpine。 原来那些shell脚本使用bash – 当然! 只要改变为sh ,因为bash不存在,导致上述错误。

最新的debian映像应该包含bash,因为它的默认CMD/bin/bash