Update from upstream - F35 + Py3.10

This commit is contained in:
Lumir Balhar 2021-12-10 11:04:56 +01:00
commit 9e2a157e7c
16 changed files with 385 additions and 188 deletions

View file

@ -1,10 +1,10 @@
# This image provides a Python 3.9 environment you can use to run your Python
# This image provides a Python 3.10 environment you can use to run your Python
# applications.
FROM registry.fedoraproject.org/f34/s2i-base:latest
FROM registry.fedoraproject.org/f35/s2i-base:latest
EXPOSE 8080
ENV PYTHON_VERSION=3.9 \
ENV PYTHON_VERSION=3.10 \
PATH=$HOME/.local/bin/:$PATH \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
@ -29,13 +29,13 @@ on most platforms."
LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="Python 3.9" \
io.k8s.display-name="Python 3.10" \
io.openshift.expose-services="8080:http" \
io.openshift.tags="builder,python,python39,python-39,rh-python39" \
io.openshift.tags="builder,python,python310,python-310,rh-python310" \
com.redhat.component="$NAME" \
name="$FGC/$NAME" \
version="$VERSION" \
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.9/test/setup-test-app/ $FGC/$NAME python-sample-app" \
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.10/test/setup-test-app/ $FGC/$NAME python-sample-app" \
maintainer="SoftwareCollections.org <sclorg@redhat.com>"
RUN INSTALL_PKGS="python3 python3-devel python3-setuptools python3-pip nss_wrapper \
@ -46,24 +46,24 @@ RUN INSTALL_PKGS="python3 python3-devel python3-setuptools python3-pip nss_wrapp
dnf -y clean all --enablerepo='*'
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
COPY 3.9/s2i/bin/ $STI_SCRIPTS_PATH
COPY 3.10/s2i/bin/ $STI_SCRIPTS_PATH
# Copy extra files to the image.
COPY 3.9/root/ /
COPY 3.10/root/ /
# Python 3 only
# Yes, the directory below is already copied by the previous command.
# The problem here is that the wheels directory is copied as a symlink.
# Only if you specify symlink directly as a source, COPY copies all the
# files from the symlink destination.
COPY 3.9/root/opt/wheels /opt/wheels
COPY 3.10/root/opt/wheels /opt/wheels
# - Create a Python virtual environment for use by any application to avoid
# potential conflicts with Python packages preinstalled in the main Python
# installation.
# - 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 python3.9 -m venv ${APP_ROOT} && \
RUN python3.10 -m venv ${APP_ROOT} && \
# Python 3 only code, Python 2 installs pip from PyPI in the assemble script. \
# We have to upgrade pip to a newer verison because: \
# * pip < 9 does not support different packages' versions for Python 2/3 \