ci(docker): fix externally-managed-environment pip error on build

Per @geerlingguy post: https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
This commit is contained in:
Andrei Jiroh Halili 2023-09-25 09:32:30 +00:00
parent c98efaae59
commit a6198f6690
2 changed files with 12 additions and 17 deletions

View file

@ -45,13 +45,18 @@ RUN apk add --no-cache \
| sh
# The "--break-system-packages" is added so I don't need to do requirements.txt workaround,
# although I also consider using pipx if we wanted to.
RUN pipx install pipenv \
&& pipenv install --system --no-cache \
mkdocs-material \
mkdocs-redirects \
# See also https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3
RUN rm -rv /usr/lib/python3*/EXTERNALLY-MANAGED \
&& pip install --no-cache \
mkdocs-material \
mkdocs-git-committers-plugin-2 \
mkdocs-git-revision-date-localized-plugin \
mkdocs-minify-plugin \
mkdocs-redirects \
mkdocs-rss-plugin \
pillow \
cairosvg
cairosvg \
pipenv
# Trust directory, required for git >= 2.35.2
# Follows the docs for the Docker-based site build setup