Merge pull request #465 from phracek/more_outputs_correct_return_states

Add support for OpenShift 3
This commit is contained in:
phracek 2021-06-30 11:18:13 +00:00
commit 50eeefac49
23 changed files with 407 additions and 23 deletions

View file

@ -46,11 +46,17 @@ 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 ./s2i/bin/ $STI_SCRIPTS_PATH
COPY 3.9/s2i/bin/ $STI_SCRIPTS_PATH
# Copy extra files to the image.
COPY ./root/ /
COPY 3.9/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
# - Create a Python virtual environment for use by any application to avoid
# potential conflicts with Python packages preinstalled in the main Python
# installation.
@ -58,6 +64,17 @@ COPY ./root/ /
# writable as OpenShift default security model is to run the container
# under random UID.
RUN python3.9 -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 \
# * pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 (and later) wheels \
# support platforms like ppc64le, aarch64 or armv7 \
# We are newly using wheel from one of the latest stable Fedora releases (from RPM python-pip-wheel) \
# because it's tested better then whatever version from PyPI and contains useful patches. \
# We have to do it here (in the macro) so the permissions are correctly fixed and pip is able \
# to reinstall itself in the next build phases in the assemble script if user wants the latest version \
${APP_ROOT}/bin/pip install /opt/wheels/pip-* && \
rm -r /opt/wheels && \
chown -R 1001:0 ${APP_ROOT} && \
fix-permissions ${APP_ROOT} -P