Use python -m venv instead of virtualenv command

https://github.com/sclorg/s2i-python-container/pull/374
This commit is contained in:
Lumir Balhar 2020-04-03 13:18:18 +02:00
commit 7bea193d56
2 changed files with 4 additions and 8 deletions

View file

@ -57,7 +57,7 @@ COPY ./root/ /
# - In order to drop the root user, we have to make some directories world
# writable as OpenShift default security model is to run the container
# under random UID.
RUN virtualenv ${APP_ROOT} && \
RUN python3.8 -m venv ${APP_ROOT} && \
chown -R 1001:0 ${APP_ROOT} && \
fix-permissions ${APP_ROOT} -P

View file

@ -9,13 +9,9 @@ function should_collectstatic() {
}
function virtualenv_bin() {
if head "/etc/redhat-release" | grep -q "^CentOS Linux release 7" || \
head "/etc/redhat-release" | grep -q "^Red Hat Enterprise Linux\( Server\)\? release 7" || \
head "/etc/redhat-release" | grep -q "^Fedora release"; then
virtualenv $1
else
virtualenv-${PYTHON_VERSION} $1
fi
# New versions of Python (>3.6) should use venv module
# from stdlib instead of virtualenv package
python3.8 -m venv $1
}
# Install pipenv to the separate virtualenv to isolate it