Dockerfile抛出一个错误“没有这样的文件或目录”
我的docker文件看起来像
FROM grpc/python CMD ["/bin/ls /"]
这是抛出一个错误:
container_linux.go:265: starting container process caused "exec: \"/bin/ls /\": stat /bin/ls /: no such file or directory" docker: Error response from daemon: oci runtime error: container_linux.go:265: starting container process caused "exec: \"/bin/ls /\": stat /bin/ls /: no such file or directory".
您需要将命令与参数分开:
CMD ["/bin/ls", "/"]
CMD
接受以下格式:
CMD ["executable","param1","param2"] (exec form, this is the preferred form) CMD ["param1","param2"] (as default parameters to ENTRYPOINT) CMD command param1 param2 (shell form)
在第二行的CMD
命令中,在ls
之后有额外的空间
- 如何在Dockerfile中设置.bash_profile环境variables?
- 如何将_directly_ COPY文件复制到Windows容器中的“Program Files(x86)”文件夹中?
- Dockerfile RUN命令的兼容性跨OS(apt-get)
- docker集装箱链接,但MySQL无法连接到
- 无法从Docker中的主机访问Web应用程序
- Dockerfile:理解VOLUME指令
- NodeJS与Docker:ENOENT:没有这样的文件或目录,打开“/app/folder/example.key”
- Docker似乎没有映射端口
- 如何让我的主机(macOS)可以访问Docker镜像/卷(Flask,Python)?