`poetry install` needs a `--force-root` or similar flag for Docker
See original GitHub issueI’ve been hacking at this for a couple hours now and I can’t find an elegant way to use poetry
to install dependencies inside of a Docker container (during build).
It either creates it’s own virtualenv which is tricky to use when you’re doing multistage or multi-base (docker compose) deployments. Or, if you supply a .venv
it won’t activate it properly and installs can fail.
RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
COPY ./pyproject.toml /app
COPY ./pyproject.lock /app
RUN python -m poetry install --no-interaction --allow-root-install
I propose a documented config setting along the lines of settings.virtualenvs.use_root true
or a install flag which conveys this as an exception to the normal flow.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
poetry install needs a --force-root or similar flag for Docker #218
I've been hacking at this for a couple hours now and I can't find an elegant way to use poetry to install dependencies...
Read more >Integrating Python Poetry with Docker - Stack Overflow
There are several things to keep in mind when using poetry together with docker . Installation. Official way to install poetry is via:...
Read more >Introduction | master | Documentation | Poetry - Python ...
Poetry requires Python 3.7+. It is multi-platform and the goal is to make it work equally well on Linux, macOS and Windows. Installation...
Read more >duffn/python-poetry - Docker Image
A series of Python Docker images that use poetry for dependency management. Because this is what I tend to do, these images also:...
Read more >A Poetic Apology. Or Why Should You Use Poetry to Manage…
Adding a development dependency works in a similar fashion with the only caveat that you need to use the --dev flag when executing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you don’t want
poetry
to automatically create virtualenvs you can set thesettings.virtualenvs.create
tofalse
like so:This does not work anymore as of poetry 0.12.1