我对Docker还很陌生,所以这个问题可能很简单。
我正在构建一个基于ubuntu:vivid镜像的镜像的Docker容器。 当在容器中执行我的脚本时,我遇到了一个错误:
exec: "python": executable file not found in $PATH
我该如何解决这个问题?当我尝试在我的Docker文件中运行apt-get install python
时:
FROM my_image # based on ubuntu:vivid
RUN apt-get update && \
apt-get install -y python3
ENV PATH /:$PATH
COPY file.py /
CMD ["python", "file.py", "-h"]
我的理解是:
WARNING: The following packages cannot be authenticated!
libexpat1 libffi6 libmagic1 libmpdec2 libssl1.0.0 libpython3.4-minimal
mime-support libsqlite3-0 libpython3.4-stdlib python3.4-minimal
python3-minimal python3.4 libpython3-stdlib dh-python python3 file
E: There are problems and -y was used without --force-yes
The command '/bin/sh -c apt-get update && apt-get install -y python3' returned a non-zero code: 100
make: *** [image] Error 1
编辑:添加了Dockerfile内容
apt-get
并不是首选。 - OneCricketeerapt-get -y update
命令。 - BMW