Cannot install Monorepo deps without sourcecode for Dockerfile caching #9682
Labels
area/installer
Related to the dependency installer
area/venv
Related to virtualenv management
kind/bug
Something isn't working as expected
status/triage
This issue needs to be triaged
Description
Hi all,
I'm having difficulty setting up a proper Dockerfile for a service in a monorepo that doesn't require the source code for the services and libraries included in the monorepo.
The monorepo has a shared
venv
. There is a rootpyproject.toml
and a few packages/libraries and services nested, each with their ownpyproject.toml
.My root
pyproject.toml
looks like this:and my service will depend on a library as such:
I'm trying to optimize my Dockerbuild so that I don't have to rebuild it everytime I have some source changes. Here's what I'd like to do:
My understanding is that
--no-root --no-directory
will allow me to install my service's deps, includingmy-library
, without needing the source code. This way, I can utilize Docker layers so I don't have to rebuild when I have source code changes.However, I keep getting this error, and I'm unsure of how to fix it - could I get some guidance?
If I copy the sources over before running
poetry install
, I don't have the issue - but I can't utilize Docker layering.Thank you guys very much!
PS - I'm also trying to use Docker's cache mount, but Poetry seems to ignore it per the Poetry Config. but that's for another day.
Workarounds
COPY the source for my library and service prior to
poetry install
- but this is undesired and slowPoetry Installation Method
pipx
Operating System
Debian
Poetry Version
Poetry 1.5.1
Poetry Configuration
The text was updated successfully, but these errors were encountered: