django app上pipenv的Docker错误:警告: - system用于预先存在的Pipfile

red*_*__1 6 django docker pipenv

当我试图将我的django应用程序停靠时,我按照一个教程告诉我如此构建我的Dockerfile

FROM python:3.6

ENV PYTHONUNBUFFERED 1

COPY . /code/
WORKDIR /code/

RUN pip install pipenv
RUN pipenv install --system

EXPOSE 8000 
Run Code Online (Sandbox Code Playgroud)

在我保存并运行之后 docker build .

系统告诉我这个错误

Warning: --system is intended to be used for pre-existing Pipfile 
installation,not installation of specific packages. Aborting.
Run Code Online (Sandbox Code Playgroud)

我认为它抱怨--system上面的后缀,但教程说它是至关重要的,以便我的包应用于整个docker容器.我是docker甚至是pipenv的新手,因为我接管了前一个人的代码并且不确定他们的pipfile在哪里,或者即使他们有pipfile.如果您对如何解决此错误有任何见解,请提前感谢您.

小智 17

pipenv --rm
Run Code Online (Sandbox Code Playgroud)

这对我有帮助!我正在启动“Django for Beginners”,一开始就出现此错误(意外删除了 Pipfile 和 Pipfile.lock)


Sar*_*iev 5

您的警告是说您Pipfile的项目目录中没有。

--system 旨在用于预先存在的 Pipfile。

所以在跑步之前

docker build .
Run Code Online (Sandbox Code Playgroud)

pipenv install 
Run Code Online (Sandbox Code Playgroud)

在您的项目文件夹中