Skip to content

Commit 2fb5c92

Browse files
committed
better handling of pip-as-root warnings
1 parent 8b387b5 commit 2fb5c92

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,18 @@ RUN \
4646
rm -rf /var/lib/apt/lists/*
4747

4848
# disable checks for `pip` upgrades (we're upgrading anyway)
49-
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
49+
ARG PIP_DISABLE_PIP_VERSION_CHECK=1
5050
# don't write .pyc files
5151
# https://stackoverflow.com/questions/59732335/is-there-any-disadvantage-in-using-pythondontwritebytecode-in-docker
5252
ENV PYTHONDONTWRITEBYTECODE=1
5353
# ensures console output is not buffered by Docker
5454
ENV PYTHONUNBUFFERED=1
55+
# Ignore warnings about running pip as root, but only for the build
56+
ARG PIP_ROOT_USER_ACTION=ignore
5557

5658
RUN python -m pip --version
57-
RUN python -m pip install pip --upgrade --root-user-action
58-
RUN python -m pip install setuptools wheel build --upgrade --root-user-action
59+
RUN python -m pip install pip --upgrade
60+
RUN python -m pip install setuptools wheel build --upgrade
5961

6062
# store Python Version; used for image tagging
6163
# ARG needs to be declared here, and above any FROM line

0 commit comments

Comments
 (0)