我有以下内容Dockerfile
:
FROM ubuntu:19.10
WORKDIR /gen
COPY script.sh ./
RUN chmod +x script.sh && export PATH="/gen/:$PATH"
ENTRYPOINT [ "script.sh" ]
它构建得很好,但我无法执行它。来自post的解决方案是添加脚本的完整路径 ( ENTRYPOINT [ "/gen/script.sh" ]
),这不起作用。
添加文件夹PATH
也不起作用。这是为什么?
错误: docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"script.sh\": executable file not found in $PATH": unknown.
编辑:问题来自我用docker run --rm -v some/dir:/gen containerName
.