我是Docker的新手,所以我很抱歉這樣一個簡單的問題。Python在碼頭集裝箱
我正在構建一個Docker容器,它建立在基於ubuntu的圖像之上:生動的圖像。 當容器內執行我的劇本,我得到一個錯誤:
exec: "python": executable file not found in $PATH
我該如何解決這個問題? 當我嘗試在我的泊塢文件運行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安裝Python或試圖找到蟒蛇可執行在烏爾機添加到$ PATH ??? – minhhn2910
也許你只是使用[官方的Python Docker鏡像](https://hub.docker.com/_/python/)? –
@ cricket_007由於我已經基於不同的圖像,我不能這樣做 – Ela