Blind update from upstream Github - Fedora 31, Python 3.7
This commit is contained in:
parent
43c71ad583
commit
c1cc83f38d
35 changed files with 2266 additions and 176 deletions
45
Dockerfile
45
Dockerfile
|
|
@ -1,10 +1,10 @@
|
|||
# This image provides a Python 3.5 environment you can use to run your Python
|
||||
# This image provides a Python 3.7 environment you can use to run your Python
|
||||
# applications.
|
||||
FROM registry.fedoraproject.org/f30/s2i-base:latest
|
||||
FROM registry.fedoraproject.org/f31/s2i-base:latest
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENV PYTHON_VERSION=3.6 \
|
||||
ENV PYTHON_VERSION=3.7 \
|
||||
PATH=$HOME/.local/bin/:$PATH \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PYTHONIOENCODING=UTF-8 \
|
||||
|
|
@ -12,12 +12,13 @@ ENV PYTHON_VERSION=3.6 \
|
|||
LANG=en_US.UTF-8 \
|
||||
PIP_NO_CACHE_DIR=off
|
||||
|
||||
|
||||
ENV NAME=python3 \
|
||||
VERSION=0 \
|
||||
ARCH=x86_64
|
||||
|
||||
ENV SUMMARY="Platform for building and running Python $PYTHON_VERSION applications" \
|
||||
DESCRIPTION="Python $PYTHON_VERSION available as docker container is a base platform for \
|
||||
DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \
|
||||
building and running various Python $PYTHON_VERSION applications and frameworks. \
|
||||
Python is an easy to learn, powerful programming language. It has efficient high-level \
|
||||
data structures and a simple but effective approach to object-oriented programming. \
|
||||
|
|
@ -28,21 +29,21 @@ on most platforms."
|
|||
LABEL summary="$SUMMARY" \
|
||||
description="$DESCRIPTION" \
|
||||
io.k8s.description="$DESCRIPTION" \
|
||||
io.k8s.display-name="Python 3.6" \
|
||||
io.k8s.display-name="Python 3.7" \
|
||||
io.openshift.expose-services="8080:http" \
|
||||
io.openshift.tags="builder,python,python36,rh-python36" \
|
||||
io.openshift.tags="builder,python,python37,python-37,rh-python37" \
|
||||
com.redhat.component="$NAME" \
|
||||
name="$FGC/$NAME" \
|
||||
version="$VERSION" \
|
||||
architecture="$ARCH" \
|
||||
usage="s2i build file:///your/app 26/python3 your-app" \
|
||||
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.7/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 python3-virtualenv \
|
||||
nss_wrapper httpd httpd-devel atlas-devel gcc-gfortran libffi-devel libtool-ltdl" && \
|
||||
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
|
||||
nss_wrapper httpd httpd-devel atlas-devel gcc-gfortran \
|
||||
libffi-devel libtool-ltdl enchant redhat-rpm-config" && \
|
||||
dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
|
||||
rpm -V $INSTALL_PKGS && \
|
||||
dnf clean all -y
|
||||
dnf -y clean all --enablerepo='*'
|
||||
|
||||
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
|
||||
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
|
||||
|
|
@ -50,15 +51,21 @@ COPY ./s2i/bin/ $STI_SCRIPTS_PATH
|
|||
# Copy extra files to the image.
|
||||
COPY ./root/ /
|
||||
|
||||
# Create a Python virtual environment for use by any application to avoid
|
||||
# potential conflicts with Python packages preinstalled in the main Python
|
||||
# installation.
|
||||
RUN virtualenv-$PYTHON_VERSION /opt/app-root
|
||||
# - 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 virtualenv ${APP_ROOT} && \
|
||||
chown -R 1001:0 ${APP_ROOT} && \
|
||||
fix-permissions ${APP_ROOT} -P
|
||||
|
||||
# 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 chown -R 1001:0 /opt/app-root && chmod -R og+rwx /opt/app-root
|
||||
# For Fedora scl_enable isn't sourced automatically in s2i-core
|
||||
# so virtualenv needs to be activated this way
|
||||
ENV BASH_ENV="${APP_ROOT}/bin/activate" \
|
||||
ENV="${APP_ROOT}/bin/activate" \
|
||||
PROMPT_COMMAND=". ${APP_ROOT}/bin/activate"
|
||||
|
||||
USER 1001
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue