[英]docker: executable file not found in $PATH": unknown
Using AWS instance based on ubuntu 18.04, Docker version 19.03.10, build 9424aeaee9.使用基于 ubuntu 18.04、Docker 版本 19.03.10 的 AWS 实例,构建 9424aeaee9。 I got the following error:我收到以下错误:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"python\": executable file not found in $PATH": unknown.
after trying to execute the code:尝试执行代码后:
docker run --name test1 c73eada5a5fa
where "c73eada5a5fa" is my container id after being built using:使用以下命令构建后,“c73eada5a5fa”是我的容器 ID:
sudo docker build -t my_username/repository .
Here is my docker:这是我的 docker:
FROM ubuntu:18.04
COPY . /PFE_exec
CMD ["make", "PFE_exec"]
CMD ["sudo","apt","install","unzip"]
CMD ["echo","requirements installed!"]
CMD ["unzip","home/ubuntu/PFE/aa.zip"]
CMD ["python","home/ubuntu/PFE/test.py"]
CMD ["python","home/ubuntu/PFE/test2.py"]
CMD ["python","home/ubuntu/PFE/test3.py"]
Using python3 instead of python doesn't resolve the problem as well.使用 python3 而不是 python 也不能解决问题。 I don't understand where is the problem.我不明白问题出在哪里。 Any help?有什么帮助吗? Thank you in advance!先感谢您!
There is no python
or python3
pre-installed in ubuntu:18.04
image, if you want to use python in your Docker, you probably want to change your base image to python image , eg FROM python:3
. ubuntu:18.04
镜像中没有python
或python3
,如果你想在你的 Docker 中使用 python,你可能需要将基础镜像更改为python 镜像,例如FROM python:3
Besides, in your Dockerfile, there should be only one CMD
, what you need is RUN
instruction instead of CMD
.此外,在你的 Dockerfile 中,应该只有一个CMD
,你需要的是RUN
指令,而不是CMD
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.