Built a docker image out of python:3.12 as base image, and image has “non-root” user, how to overcome this below error
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
installed python poetry
poetry install
Installing dependencies from lock file
Package operations: 42 installs, 0 updates, 0 removals
- Installing pycparser (2.22)
- Installing certifi (2024.6.2)
- Installing cffi (1.16.0)
- Installing idna (3.7)
- Installing markupsafe (2.1.5)
- Installing charset-normalizer (3.3.2)
- Installing urllib3 (2.2.1)
Installing /builds/acme-deploy-tools/.venv/bin/normalizer over existing file
PermissionError
[Errno 13] Permission denied: '/builds/acme-deploy-tools/.venv/bin/normalizer'
at /usr/lib/python3.11/pathlib.py:1044 in open
1040│ the built-in open() function does.
1041│ """
1042│ if "b" not in mode:
1043│ encoding = io.text_encoding(encoding)
→ 1044│ return io.open(self, mode, buffering, encoding, errors, newline)
1045│
1046│ def read_bytes(self):
1047│ """
1048│ Open the file in bytes mode, read it, and close the file.
Cannot install charset-normalizer.
make: *** [Makefile:40: poetry-install] Error 1
the .gitlab-ci.yaml only have these lines set :
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry install
And wanting to see how to overcome above permission error as we have to meet the requirement of security especially root user should not be used. And docker image is based on alpine.
1