Python in docker container
I am new to Docker so I am sorry for such an easy question.
I am building a docker container which is built on top of a image which is built on ubuntu:vivid image.
When executing my script within the container I am getting an error:
exec: "python": executable file not found in $PATH
How can I solve this?
When I try to run
apt-get install python in my Docker file:
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
EDIT: added Dockerfile content
One Solution collect form web for “Python in docker container”
You have similar issue with some Linux distribution: “Why am I getting authentication errors for packages from an Ubuntu repository?”
In all cases, the usual sequence of command to install new packages is:
RUN apt-get update -yq && apt-get install -yqq \ git \ python \ ...
The OP Ela reports in the comments:
RUN apt-get update -y && apt-get install -y --force-yes \ git \ python \ ...