如何在Dockerfile中添加PYTHONPATH的路径?这样当容器运行时它有正确的PYTHONPATH?我对码头工作者来说是新手.
我已将ENV PYTHONPATH“${PYTONPATH}:/ control”添加到Dockerfile中,因为我想将目录/控件添加到PYTHONPATH.
当我使用docker exec -it trusting_spence bash和open python访问容器bash并运行下面的命令时,目录控件不在列表中.
导入系统
打印(sys.path中)
FROM python:2
RUN pip install requests\
&& pip install pymongo
RUN mkdir control
COPY control_file/ /control
ENV PYTHONPATH "${PYTONPATH}:/control"
CMD ["python","control/control_file/job.py"]
最佳答案