django - django 应用程序上 pipenv 的 Docker 错误:警告:--system 旨在用于预先存在的 Pipfile
问题描述
当我尝试对我的 django 应用程序进行 docker 化时,我按照教程告诉我像这样构建我的 Dockerfile
FROM python:3.6
ENV PYTHONUNBUFFERED 1
COPY . /code/
WORKDIR /code/
RUN pip install pipenv
RUN pipenv install --system
EXPOSE 8000
在我保存并运行之后docker build .
系统向我抛出了这个错误
Warning: --system is intended to be used for pre-existing Pipfile
installation,not installation of specific packages. Aborting.
我认为它在抱怨--system
上面的后缀,但教程说拥有它至关重要,这样我的包才能应用于整个 docker 容器。我是 docker 甚至是 pipenv 的新手,因为我接手了以前的人的代码,并且不确定他们的 pipfile 在哪里,或者即使他们有 pipfile。如果您对如何解决此错误有任何见解,请提前感谢您。
解决方案
您的警告是说您Pipfile
的项目目录中没有。
--system 旨在用于预先存在的 Pipfile。
所以在运行之前
docker build .
跑
pipenv install
在您的项目文件夹中
推荐阅读
- azure - 如何在 Azure 链接服务中连接 Azure 托管实例
- firefox-os - 不能使用 KaiOS 模拟器
- c++ - QPieSlice 的 Qt 坐标
- azure - Azure App Gateway 出现错误 404,但后端探测正常
- objective-c - Objective c ProgressView 没有正确更新
- powerbi - 如何在power bi中将二进制字段转换为图像文件
- oracle - Oracle 软件包的赠款
- qt - 如何在布局中正确嵌套 QML ListView 的尺寸?
- android - 分页库 - 一个具有多种视图类型的回收器
- python - 将文件复制到目录时出现 FileNotFoundError