Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker error with pipenv on django app: Warning: --system is intended to be used for pre-existing Pipfile

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 

After I saved that and run docker build .

the system threw me this error

Warning: --system is intended to be used for pre-existing Pipfile 
installation,not installation of specific packages. Aborting.

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.

like image 997
reddd__1 Avatar asked May 07 '18 14:05

reddd__1


1 Answers

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

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

So before running

docker build .

run

pipenv install 

in your project folder

like image 193
Sardorbek Imomaliev Avatar answered Sep 16 '22 19:09

Sardorbek Imomaliev