-vvv option).
We installed poetry into docker following these steps:
- apt-get update -yqq
- apt-get upgrade -yqq
- apt-get install -yqq --no-install-recommends build-essential python-dev
- pip install -U pip poetry
- poetry config settings.virtualenvs.create false
- poetry install --no-interaction --no-ansi
- poetry run pytest
as we only have this package into the docker image, we don't care about virtualenvs, this is the reason we have this: poetry config settings.virtualenvs.create false
when testing into the CI environment, when running the docker container with a non privileged user like: USER nobody
docker run --rm <DOCKER_IMAGE> poetry run pytest
if fails, raising this error:
$ docker run --rm <DOCKER_IMAGE> poetry run pytest
Creating virtualenv upsell-py3.7 in /nonexistent/.cache/pypoetry/virtualenvs
[PermissionError]
[Errno 13] Permission denied: '/nonexistent'
run <args> (<args>)...
So, my conclusion is that even when explicitly set to not create virtualenvs:
poetry config settings.virtualenvs.create false
this setting is ignored when using: poetry run
@jfunez the problem here is that when you execute poetry config settings.virtualenvs.create false, the configuration is written to $HOME/.config/pypoetry/config.toml. The environment variable $HOME on most containers on Docker Hub (eg: python:3.7) will evaluate to /root.
During build, in your case, poetry updates its configuration such that it pertains only to the root user (/root/.config/pypoetry/config.toml). Once you switch user to nobody, $HOME evaluates to /nonexistent. This, as the name suggests, does not exist and hence poetry assumes defaults which is to create virtualenvs.
This leads to your reported issue.
@jfunez Could you test with the latest 1.0.0b2 release and by setting a POETRY_VIRTUALENVS_CREATE=false environment variables. If you want more information about this new feature you can check #1272
hi @sdispater
not now, but I will try asap!
thanks!
Closing this for now. @jfunez If the suggestion I made does not fix the issue, feel free to reopen it.
Most helpful comment
@jfunez Could you test with the latest
1.0.0b2release and by setting aPOETRY_VIRTUALENVS_CREATE=falseenvironment variables. If you want more information about this new feature you can check #1272