Pipenv: Workflow for installing path outside current directory in Docker

Created on 11 Apr 2019  路  4Comments  路  Source: pypa/pipenv

Re-opening a ticket for https://github.com/pypa/pipenv/issues/3027#issuecomment-447312579

Any suggestion if the editable package is located outside of the current application?

Let's assume you have this folder structure

/application
-- Dockerfile
-- Pipfile
-- Pipfile.lock
/lib1 # local python package

and I want to install local editable package lib1. My entry in the Pipfile looks like:

lib1 = {path = "./../lib1",editable = true}

And my Dockerfile looks like:

RUN pipenv install --system --deploy

Running cd application && docker build . is failing with the following error:

ValueError: Invalid path './../lib1'

What is the recommended solution here?

Docker Type

Most helpful comment

cd application && docker build . is going to set your docker context to /application - at which point everything external to that directory is no longer accessible.

I think you might need to use the project directory as the build context and manually specify the dockerfile.

docker build -f application/Dockerfile .

All 4 comments

I can't reproduce with exactly the same Pipfile as you describe.

So can you try against master branch?

cd application && docker build . is going to set your docker context to /application - at which point everything external to that directory is no longer accessible.

I think you might need to use the project directory as the build context and manually specify the dockerfile.

docker build -f application/Dockerfile .

@haroldtreen Thanks for your reply, that helps clarify the problem. I forgot it was about docker build so your explanation makes sense.

Thanks @haroldtreen this is exactly what I wanted

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakul picture jakul  路  3Comments

erinxocon picture erinxocon  路  3Comments

randName picture randName  路  3Comments

jerzyk picture jerzyk  路  3Comments

FooBarQuaxx picture FooBarQuaxx  路  3Comments