Why the $PATH of my container is different when I execute a command outside the container?

Viewed 19

When I execute the which python3 command outside the container, this is the result:

/usr/bin/python3

But when i am inside the running container this is the result:

root@3d95a2c1307c:/# which python3
/local//Miniconda3/bin/python3

I want to use the Python located in the second path. What is going on? I included this step on the dockerfile:

ENV PATH=/local/Miniconda3/bin:$PATH
1 Answers

Depending on the image you use for your container (which is not clear at all in your questions), you might have different or custom $PATH, and respectively different python executable path.. So if the container's $PATH accommodates a custom path for python. maybe that is what it needs to correctly run the image.. again not clear in your Question.

Related