Skip to content

Commit b819b60

Browse files
befelemephracek
authored andcommitted
Distgen generated content
1 parent 91349d3 commit b819b60

File tree

9 files changed

+216
-14
lines changed

9 files changed

+216
-14
lines changed

3.11-minimal/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Because the minimal and full images work similarly, we document here only the di
88
of the minimal container image. For the documentation of common features see the [full container image docs](https://github.com/sclorg/s2i-python-container/tree/master/3.11).
99

1010
The Python 3.11 minimal container image is currently considered a tech-preview and only available on quay.io.
11-
The image is built on top of the [Red Hat Universal Base Image 8 Micro image](https://catalog.redhat.com/software/containers/ubi8-micro/601a84aadd19c7786c47c8ea)
12-
and therefore uses the RPM packages from Red Hat Enterprise Linux, the same that are used by Python 3.9 supported container image and are part of the [UBI registry](https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image).
11+
The image is built on top of the [official CentOS Stream base containers](quay.io/centos/centos).
1312

1413
To pull the Python 3.11 minimal container image to build on, run
1514

3.11/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -381,5 +381,6 @@ See also
381381
--------
382382
Dockerfile and other sources are available on https://github.com/sclorg/s2i-python-container.
383383
In that repository you also can find another versions of Python environment Dockerfiles.
384-
Dockerfile for CentOS is called `Dockerfile`, Dockerfile for RHEL7 is called `Dockerfile.rhel7`,
385-
for RHEL8 it's `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9` and the Fedora Dockerfile is called `Dockerfile.fedora`.
384+
Dockerfile for RHEL8 is called `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9`,
385+
for CentOS Stream 9 it's `Dockerfile.c9s`, for CentOS Stream 10 it's `Dockerfile.c10s`,
386+
and the Fedora Dockerfile is called `Dockerfile.fedora`.

3.12-minimal/Dockerfile.c10s

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
FROM quay.io/centos/centos:stream10-development-minimal
2+
3+
4+
EXPOSE 8080
5+
6+
ENV PYTHON_VERSION=3.12 \
7+
PYTHONUNBUFFERED=1 \
8+
PYTHONIOENCODING=UTF-8 \
9+
LC_ALL=en_US.UTF-8 \
10+
LANG=en_US.UTF-8 \
11+
CNB_STACK_ID=com.redhat.stacks.ubi10-python-312 \
12+
CNB_USER_ID=1001 \
13+
CNB_GROUP_ID=0 \
14+
PIP_NO_CACHE_DIR=off \
15+
# The following variables are usually available from parent s2i images \
16+
STI_SCRIPTS_PATH=/usr/libexec/s2i \
17+
APP_ROOT=/opt/app-root \
18+
HOME=/opt/app-root/src \
19+
PLATFORM="el10"
20+
21+
# /opt/app-root/bin - the main venv
22+
# /opt/app-root/src/bin - app-specific binaries
23+
# /opt/app-root/src/.local/bin - tools like pipenv
24+
ENV PATH=$APP_ROOT/bin:$HOME/bin:$HOME/.local/bin:$PATH
25+
26+
# RHEL7 base images automatically set these envvars to run scl_enable. RHEl8
27+
# images, however, don't as most images don't need SCLs any more. But we want
28+
# to run it even on RHEL8, because we set the virtualenv environment as part of
29+
# that script
30+
ENV BASH_ENV=${APP_ROOT}/etc/scl_enable \
31+
ENV=${APP_ROOT}/etc/scl_enable \
32+
PROMPT_COMMAND=". ${APP_ROOT}/etc/scl_enable"
33+
34+
ENV SUMMARY="Minimal platform for building and running Python $PYTHON_VERSION applications" \
35+
DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \
36+
building and running various Python $PYTHON_VERSION applications and frameworks. \
37+
Python is an easy to learn, powerful programming language. It has efficient high-level \
38+
data structures and a simple but effective approach to object-oriented programming. \
39+
Python's elegant syntax and dynamic typing, together with its interpreted nature, \
40+
make it an ideal language for scripting and rapid application development in many areas \
41+
on most platforms."
42+
43+
LABEL summary="$SUMMARY" \
44+
description="$DESCRIPTION" \
45+
io.k8s.description="$DESCRIPTION" \
46+
io.k8s.display-name="Python 3.12" \
47+
io.openshift.expose-services="8080:http" \
48+
io.openshift.tags="builder,python,python312,python-312,rh-python312" \
49+
com.redhat.component="python-312-container" \
50+
name="sclorg/python-312-minimal-c10s" \
51+
version="1" \
52+
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.12-minimal/test/setup-test-app/ ubi10/python-312-minimal python-sample-app" \
53+
com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
54+
io.buildpacks.stack.id="com.redhat.stacks.ubi10-python-312-minimal" \
55+
maintainer="SoftwareCollections.org <[email protected]>"
56+
57+
# Very minimal set of packages
58+
# Python is obvious in the Python container :)
59+
# glibc-langpack-en is needed to set locale to en_US and disable warning about it
60+
# findutils - find command is needed for fix-permissions script
61+
# nss_wrapper - used in generate_container_user script
62+
RUN INSTALL_PKGS="python3.12 glibc-langpack-en findutils nss_wrapper" && \
63+
microdnf -y --setopt=tsflags=nodocs --setopt=install_weak_deps=0 install $INSTALL_PKGS && \
64+
microdnf -y clean all --enablerepo='*'
65+
66+
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
67+
COPY 3.12-minimal/s2i/bin/ $STI_SCRIPTS_PATH
68+
69+
# Copy extra files to the image.
70+
COPY 3.12-minimal/root/ /
71+
72+
# Python 3.7+ only
73+
# Yes, the directory below is already copied by the previous command.
74+
# The problem here is that the wheels directory is copied as a symlink.
75+
# Only if you specify symlink directly as a source, COPY copies all the
76+
# files from the symlink destination.
77+
COPY 3.12/root/opt/wheels /opt/wheels
78+
79+
# This command sets (and also creates if necessary)
80+
# the home directory - it has to be done here so the latter
81+
# fix-permissions fixes this directory as well.
82+
WORKDIR ${HOME}
83+
84+
# - Create a Python virtual environment for use by any application to avoid
85+
# potential conflicts with Python packages preinstalled in the main Python
86+
# installation.
87+
# - In order to drop the root user, we have to make some directories world
88+
# writable as OpenShift default security model is to run the container
89+
# under random UID.
90+
RUN \
91+
python3.12 -m venv ${APP_ROOT} && \
92+
# We have to upgrade pip to a newer version because \
93+
# pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 (and later) wheels \
94+
# support platforms like ppc64le, aarch64 or armv7 \
95+
# We are newly using wheel from one of the latest stable Fedora releases (from RPM python-pip-wheel) \
96+
# because it's tested better then whatever version from PyPI and contains useful patches. \
97+
# We have to do it here so the permissions are correctly fixed and pip is able \
98+
# to reinstall itself in the next build phases in the assemble script if user wants the latest version \
99+
${APP_ROOT}/bin/pip install /opt/wheels/pip-* && \
100+
rm -r /opt/wheels && \
101+
chown -R 1001:0 ${APP_ROOT} && \
102+
fix-permissions ${APP_ROOT} -P && \
103+
rpm-file-permissions
104+
105+
USER 1001
106+
107+
# Set the default CMD to print the usage of the language image.
108+
CMD $STI_SCRIPTS_PATH/usage

3.12-minimal/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Because the minimal and full images work similarly, we document here only the di
88
of the minimal container image. For the documentation of common features see the [full container image docs](https://github.com/sclorg/s2i-python-container/tree/master/3.12).
99

1010
The Python 3.12 minimal container image is currently considered a tech-preview and only available on quay.io.
11-
The image is built on top of the [Red Hat Universal Base Image 8 Micro image](https://catalog.redhat.com/software/containers/ubi8-micro/601a84aadd19c7786c47c8ea)
12-
and therefore uses the RPM packages from Red Hat Enterprise Linux, the same that are used by Python 3.9 supported container image and are part of the [UBI registry](https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image).
11+
The image is built on top of the [official CentOS Stream base containers](quay.io/centos/centos).
1312

1413
To pull the Python 3.12 minimal container image to build on, run
1514

3.12/Dockerfile.c10s

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# This image provides a Python 3.12 environment you can use to run your Python
2+
# applications.
3+
FROM quay.io/sclorg/s2i-base-c10s:c10s
4+
5+
EXPOSE 8080
6+
7+
ENV PYTHON_VERSION=3.12 \
8+
PATH=$HOME/.local/bin/:$PATH \
9+
PYTHONUNBUFFERED=1 \
10+
PYTHONIOENCODING=UTF-8 \
11+
LC_ALL=en_US.UTF-8 \
12+
LANG=en_US.UTF-8 \
13+
PIP_NO_CACHE_DIR=off
14+
15+
ENV NAME=python3 \
16+
VERSION=0 \
17+
ARCH=x86_64
18+
19+
ENV SUMMARY="Platform for building and running Python $PYTHON_VERSION applications" \
20+
DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \
21+
building and running various Python $PYTHON_VERSION applications and frameworks. \
22+
Python is an easy to learn, powerful programming language. It has efficient high-level \
23+
data structures and a simple but effective approach to object-oriented programming. \
24+
Python's elegant syntax and dynamic typing, together with its interpreted nature, \
25+
make it an ideal language for scripting and rapid application development in many areas \
26+
on most platforms."
27+
28+
LABEL summary="$SUMMARY" \
29+
description="$DESCRIPTION" \
30+
io.k8s.description="$DESCRIPTION" \
31+
io.k8s.display-name="Python 3.12" \
32+
io.openshift.expose-services="8080:http" \
33+
io.openshift.tags="builder,python,python312,python-312,rh-python312" \
34+
com.redhat.component="$NAME" \
35+
name="sclorg/python-312-c10s" \
36+
version="$VERSION" \
37+
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.12/test/setup-test-app/ $FGC/$NAME python-sample-app" \
38+
maintainer="SoftwareCollections.org <[email protected]>"
39+
40+
RUN INSTALL_PKGS="python3 python3-devel python3-setuptools python3-pip nss_wrapper \
41+
httpd httpd-devel mod_ssl mod_auth_gssapi mod_ldap \
42+
mod_session gcc-gfortran libffi-devel libtool-ltdl krb5-devel" && \
43+
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
44+
rpm -V $INSTALL_PKGS && \
45+
yum -y clean all --enablerepo='*'
46+
47+
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
48+
COPY 3.12/s2i/bin/ $STI_SCRIPTS_PATH
49+
50+
# Copy extra files to the image.
51+
COPY 3.12/root/ /
52+
53+
# Python 3.7+ only
54+
# Yes, the directory below is already copied by the previous command.
55+
# The problem here is that the wheels directory is copied as a symlink.
56+
# Only if you specify symlink directly as a source, COPY copies all the
57+
# files from the symlink destination.
58+
COPY 3.12/root/opt/wheels /opt/wheels
59+
# - Create a Python virtual environment for use by any application to avoid
60+
# potential conflicts with Python packages preinstalled in the main Python
61+
# installation.
62+
# - In order to drop the root user, we have to make some directories world
63+
# writable as OpenShift default security model is to run the container
64+
# under random UID.
65+
RUN python3.12 -m venv ${APP_ROOT} && \
66+
# Python 3.7+ only code, Python <3.7 installs pip from PyPI in the assemble script. \
67+
# We have to upgrade pip to a newer verison because \
68+
# pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 (and later) wheels \
69+
# support platforms like ppc64le, aarch64 or armv7 \
70+
# We are newly using wheel from one of the latest stable Fedora releases (from RPM python-pip-wheel) \
71+
# because it's tested better then whatever version from PyPI and contains useful patches. \
72+
# We have to do it here (in the macro) so the permissions are correctly fixed and pip is able \
73+
# to reinstall itself in the next build phases in the assemble script if user wants the latest version \
74+
${APP_ROOT}/bin/pip install /opt/wheels/pip-* && \
75+
rm -r /opt/wheels && \
76+
chown -R 1001:0 ${APP_ROOT} && \
77+
fix-permissions ${APP_ROOT} -P && \
78+
# The following echo adds the unset command for the variables set below to the \
79+
# venv activation script. This is inspired from scl_enable script and prevents \
80+
# the virtual environment to be activated multiple times and also every time \
81+
# the prompt is rendered. \
82+
echo "unset BASH_ENV PROMPT_COMMAND ENV" >> ${APP_ROOT}/bin/activate
83+
84+
# For Fedora scl_enable isn't sourced automatically in s2i-core
85+
# so virtualenv needs to be activated this way
86+
ENV BASH_ENV="${APP_ROOT}/bin/activate" \
87+
ENV="${APP_ROOT}/bin/activate" \
88+
PROMPT_COMMAND=". ${APP_ROOT}/bin/activate"
89+
90+
USER 1001
91+
92+
# Set the default CMD to print the usage of the language image.
93+
CMD $STI_SCRIPTS_PATH/usage

3.12/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -381,5 +381,6 @@ See also
381381
--------
382382
Dockerfile and other sources are available on https://github.com/sclorg/s2i-python-container.
383383
In that repository you also can find another versions of Python environment Dockerfiles.
384-
Dockerfile for CentOS is called `Dockerfile`, Dockerfile for RHEL7 is called `Dockerfile.rhel7`,
385-
for RHEL8 it's `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9` and the Fedora Dockerfile is called `Dockerfile.fedora`.
384+
Dockerfile for RHEL8 is called `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9`,
385+
for CentOS Stream 9 it's `Dockerfile.c9s`, for CentOS Stream 10 it's `Dockerfile.c10s`,
386+
and the Fedora Dockerfile is called `Dockerfile.fedora`.

3.6/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -381,5 +381,6 @@ See also
381381
--------
382382
Dockerfile and other sources are available on https://github.com/sclorg/s2i-python-container.
383383
In that repository you also can find another versions of Python environment Dockerfiles.
384-
Dockerfile for CentOS is called `Dockerfile`, Dockerfile for RHEL7 is called `Dockerfile.rhel7`,
385-
for RHEL8 it's `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9` and the Fedora Dockerfile is called `Dockerfile.fedora`.
384+
Dockerfile for RHEL8 is called `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9`,
385+
for CentOS Stream 9 it's `Dockerfile.c9s`, for CentOS Stream 10 it's `Dockerfile.c10s`,
386+
and the Fedora Dockerfile is called `Dockerfile.fedora`.

3.9-minimal/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Because the minimal and full images work similarly, we document here only the di
88
of the minimal container image. For the documentation of common features see the [full container image docs](https://github.com/sclorg/s2i-python-container/tree/master/3.9).
99

1010
The Python 3.9 minimal container image is currently considered a tech-preview and only available on quay.io.
11-
The image is built on top of the [Red Hat Universal Base Image 8 Micro image](https://catalog.redhat.com/software/containers/ubi8-micro/601a84aadd19c7786c47c8ea)
12-
and therefore uses the RPM packages from Red Hat Enterprise Linux, the same that are used by Python 3.9 supported container image and are part of the [UBI registry](https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image).
11+
The image is built on top of the [official CentOS Stream base containers](quay.io/centos/centos).
1312

1413
To pull the Python 3.9 minimal container image to build on, run
1514

3.9/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -381,5 +381,6 @@ See also
381381
--------
382382
Dockerfile and other sources are available on https://github.com/sclorg/s2i-python-container.
383383
In that repository you also can find another versions of Python environment Dockerfiles.
384-
Dockerfile for CentOS is called `Dockerfile`, Dockerfile for RHEL7 is called `Dockerfile.rhel7`,
385-
for RHEL8 it's `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9` and the Fedora Dockerfile is called `Dockerfile.fedora`.
384+
Dockerfile for RHEL8 is called `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9`,
385+
for CentOS Stream 9 it's `Dockerfile.c9s`, for CentOS Stream 10 it's `Dockerfile.c10s`,
386+
and the Fedora Dockerfile is called `Dockerfile.fedora`.

0 commit comments

Comments
 (0)