DOCKER Python 路径
DOCKER Python Path
我是 Docker 的新手。 1 事情让我感到困惑,当我在 Docker 中打印 python 的输出时,它指向系统的 python,尽管我已经提到 python3.7 作为基本图像,所以它应该指向图像 python 对吗?
我的docker文件如下:
FROM python:3.7
RUN which python3
RUN which python3.7
RUN which python
输出为
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM python:3.7
---> 7c891de3e220
Step 2/4 : RUN which python3
---> Running in bfcab000b493
/usr/local/bin/python3
Removing intermediate container bfcab000b493
---> be30731a0a5a
Step 3/4 : RUN which python3.7
---> Running in 144cf28963eb
/usr/local/bin/python3.7
Removing intermediate container 144cf28963eb
---> 7434c6aa69cb
Step 4/4 : RUN which python
---> Running in 88e3133f4e41
/usr/local/bin/python
Removing intermediate container 88e3133f4e41
---> 872bfb66fc7d
Successfully built 872bfb66fc7d
Successfully tagged docker_testing:latest
您可以看到它正在响应所有 python 到 /usr/bin/pythonx
我想问一下这个是不是正在使用的Docker的Python,还是正在使用我系统的Python.
谢谢。
我是 Docker 的新手。 1 事情让我感到困惑,当我在 Docker 中打印 python 的输出时,它指向系统的 python,尽管我已经提到 python3.7 作为基本图像,所以它应该指向图像 python 对吗?
我的docker文件如下:
FROM python:3.7
RUN which python3
RUN which python3.7
RUN which python
输出为
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM python:3.7
---> 7c891de3e220
Step 2/4 : RUN which python3
---> Running in bfcab000b493
/usr/local/bin/python3
Removing intermediate container bfcab000b493
---> be30731a0a5a
Step 3/4 : RUN which python3.7
---> Running in 144cf28963eb
/usr/local/bin/python3.7
Removing intermediate container 144cf28963eb
---> 7434c6aa69cb
Step 4/4 : RUN which python
---> Running in 88e3133f4e41
/usr/local/bin/python
Removing intermediate container 88e3133f4e41
---> 872bfb66fc7d
Successfully built 872bfb66fc7d
Successfully tagged docker_testing:latest
您可以看到它正在响应所有 python 到 /usr/bin/pythonx
我想问一下这个是不是正在使用的Docker的Python,还是正在使用我系统的Python.
谢谢。