Skip to content

Commit 4f6e30a

Browse files
committed
Add dist-gen generated files
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent 439dfbf commit 4f6e30a

6 files changed

Lines changed: 600 additions & 0 deletions

File tree

3.14-minimal/Dockerfile.c10s

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

3.14-minimal/Dockerfile.c9s

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

3.14-minimal/Dockerfile.rhel10

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

0 commit comments

Comments
 (0)