You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
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 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.
@sdispater Can we get this reopened? Currently poetry doesn't have a satisfactory resolution for it, be that a flag or documentation for the existing way to do this. The setting is a bit too complicated currently because I don't know if I can include it in the pyproject.toml, or if I need to run it in Docker, or what...
I'm curious about the details of this statement from OP @blakev, even if a change is not made to poetry in relation to it :) As I am about to use poetry with virtualenv with multistage builds, probably.
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.
I think use config seems not a good idea compare to directly pass command line options.
command-line-option is more self-explain, more close to where it was really used. And more convention while using in gitlab-ci or docker build, which will need only one command instead of two.
And who would like to keep a config file in gitlab CI worker or docker images??
anyway even if some command line tool use config file, they will provide command line option to override the default config as a choices.
how ever the poetry seems high depend on config file and not provide equal command option, which make it something hard to use and hard to find the solution.
Activity
sdispater commentedon Jun 15, 2018
If you don't want
poetryto automatically create virtualenvs you can set thesettings.virtualenvs.createtofalselike so:blakev commentedon Jun 15, 2018
This works! Thanks.
blakev commentedon Oct 25, 2018
This does not work anymore as of poetry 0.12.1
robertpro commentedon Jan 12, 2019
@blakev can you share your Dockerfile?
skorokithakis commentedon Jan 28, 2019
@sdispater Can we get this reopened? Currently poetry doesn't have a satisfactory resolution for it, be that a flag or documentation for the existing way to do this. The setting is a bit too complicated currently because I don't know if I can include it in the
pyproject.toml, or if I need to run it in Docker, or what...floer32 commentedon Mar 14, 2019
I'm curious about the details of this statement from OP @blakev, even if a change is not made to poetry in relation to it :) As I am about to use poetry with virtualenv with multistage builds, probably.
hackrole commentedon Nov 26, 2019
I think use config seems not a good idea compare to directly pass command line options.
command-line-option is more self-explain, more close to where it was really used. And more convention while using in gitlab-ci or docker build, which will need only one command instead of two.
And who would like to keep a config file in gitlab CI worker or docker images??
anyway even if some command line tool use config file, they will provide command line option to override the default config as a choices.
how ever the poetry seems high depend on config file and not provide equal command option, which make it something hard to use and hard to find the solution.
blakev commentedon Jan 9, 2020
Amazing how this has come full circle, since I ran into this issue AGAIN today.
This is the way to solve it,
github-actions commentedon Mar 3, 2024
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.