I’m trying to run Python code in a Nodejs image build, I added the following to the Dockerfile,
RUN apt-get update -qq &&
apt-get install -y python3 .
But it did not install python3 at all, any ideas?
Those commands look correct, the next question relates to where they are placed.
If your Dockerfile has multiple FROM
statements, each defines a new image, possibly based on a previous image built in this same Dockerfile.
Take a look at this Dockerfile as an example: dockerfile-node/test/base/build/Dockerfile at main · fly-apps/dockerfile-node · GitHub
It installs python in the build image but the final image is based on the original base which does not include python.
1 Like
Thank you, it is indeed as you said, I put it in the last image and it worked correctly.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.