Docker容器命令找不到shell脚本
这是我的Dockerfile:Docker容器命令找不到shell脚本,docker,dockerfile,Docker,Dockerfile,这是我的Dockerfile: FROM debian MAINTAINER Andrew Ford<andrew.ford@gg.com> RUN apt-get update COPY entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] 然后我跑: docker build --no-cache=true -t test/dockerfile-sayhello . docker run test/dockerfile-sayhell
FROM debian
MAINTAINER Andrew Ford<andrew.ford@gg.com>
RUN apt-get update
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
然后我跑:
docker build --no-cache=true -t test/dockerfile-sayhello .
docker run test/dockerfile-sayhello
当我跑的时候:
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..
我试着在谷歌上搜索,看看我是否犯了任何明显的错误,但到目前为止我还没能识别出来。也许你们中的一些人可以帮忙
编辑:还运行chmod+x entrypoint.sh以授予权限我刚刚尝试了以下Dockerfile(添加
chmod
)
来自debian的
维修人员安德鲁·福特:
我尝试将Dockerfile设置从phusion/baseimage转换为gliderslabs/alpine。原来那些shell脚本使用的是bash
——当然!只需更改为sh
,因为bash
不存在,导致上述错误
最新版本应该包括bash,因为它的默认值CMD
是/bin/bash
我刚刚尝试了以下Dockerfile(添加chmod
)
来自debian的
维修人员安德鲁·福特:
我尝试将Dockerfile设置从phusion/baseimage转换为gliderslabs/alpine。原来那些shell脚本使用的是bash
——当然!只需更改为sh
,因为bash
不存在,导致上述错误
最新版本应该包括bash,因为它的默认值CMD
是/bin/bash
docker运行测试/dockerfile sayhello ls-l/entrypoint
输出是什么?您的脚本文件是否有unix行结尾?它返回相同的内容,是的,它确实有unix行结尾try/entrypoint.sh
。也尝试了entrypoint[“/entrypoint.sh”],但返回相同的错误docker运行测试/dockerfile sayhello ls-l/entrypoint
输出是什么?您的脚本文件是否有unix行结尾?它返回相同的内容,是的,它确实有unix行结尾try/entrypoint.sh
。也尝试了entrypoint[“/entrypoint.sh”],但返回相同的错误