Django应用上Pipenv的Docker错误:警告:--system旨在用于预先存在的Pipfile [英] Docker error with pipenv on django app: Warning: --system is intended to be used for pre-existing Pipfile

查看:54
本文介绍了Django应用上Pipenv的Docker错误:警告:--system旨在用于预先存在的Pipfile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试对django应用进行docker化时,我遵循了一个教程,该教程告诉我以这种方式构造Dockerfile

When I was trying to dockerize my django app, I followed a tutorial telling me to structure my Dockerfile like this

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.如果您对如何解决此错误有任何见解,请先谢谢您.

I think it is complaining about the --system suffix above but the tutorial says it's crucial to have it so that my packages are applied in the entire docker container. I'm new to docker and even pipenv because I took over a previous person's code and isn't sure where their pipfile is or even if they have a pipfile. If you have any insights on how to fix this error thank you in advance.

推荐答案

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

Your warning is saying you that there is no Pipfile in your project dir.

-系统旨在用于预先存在的Pipfile.

--system is intended to be used for pre-existing Pipfile.

所以在运行

docker build .

运行

pipenv install 

在您的项目文件夹中

这篇关于Django应用上Pipenv的Docker错误:警告:--system旨在用于预先存在的Pipfile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆