question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Git submodules in docker

See original GitHub issue

pipenv, version 11.10.0

I have a submodule ./dep1 in my git repo and am adding it to pipenv via pipenv install -e dep1, which works just fine and adds the line

"abc123" = {path = "./dep1", editable = true}

to my Pipfile. Then I use a Dockerfile as follows:

FROM kennethreitz/pipenv
COPY ./app /app
COPY ./dep1 /app/dep1
CMD python3 start.py

where I added the third line, so the submodule is available in the WORKDIR. However, upon docker build I am getting the following error

+ pipenv install --deploy --system
Installing -e ./dep1…

Error:  An error occurred while installing -e ./dep1!
./dep1 should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+

This is unexpected, since ./dep1 is a path to a local project, relative to the WORKDIR in the docker image with the Pipfile, which is /app. Am I missing something or is this a bug?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
erinxoconcommented, Jun 25, 2018

I don’t think my solution is the proper way, I’m working on another, but essentially, when the pipfile references the local package, the lockfile becomes different for each platform, your host machine and the docker instance since they are in difference places. pipenv install creates a virtualenv, and relocks the pipfile and then pipenv install --deploy --system uses that new updated lockfile for the install. So we are essentially creating a virtualenv when it’s not needed to sync lockfiles after you install the new local dep…I’m looking into a better Dockerfile solution now.

1reaction
techalchemycommented, Jun 26, 2018

(For the record it was much simpler than that, thankfully)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Efficient development workflow using Git submodules and ...
Attempt to describe the development workflow based on Docker that we are using daily at Continuous Software. Feel free to make a pull...
Read more >
Developing Docker Multiservices Application Using Git ...
Git submodule is one of GIT feature that allow us to keep a GIT repository as a subdirectory of another GIT repository. This...
Read more >
Using git submodule during Docker build - Stack Overflow
1 Answer 1 · Keep the orchestration directory · Remove all submodules from that directory · Now clone each service inside the orchestration...
Read more >
Managing microservices with dockers and git-submodules
Add docker-compose to describe the local environment. Use the submodules as the code for the dockers and mount them to the container with...
Read more >
Use git submodules to install a private, custom python ...
We're going to use git submodules to pull the package into our project directory, install it and then modify our Dockerfile to install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found