Skip to content

Commit 34bb9b3

Browse files
committed
Generate Dockerfiles using distgen
1 parent 99e8f07 commit 34bb9b3

17 files changed

+297
-63
lines changed

2.7/Dockerfile

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ LABEL summary="$SUMMARY" \
3333
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=2.7/test/setup-test-app/ centos/python-27-centos7 python-sample-app" \
3434
maintainer="SoftwareCollections.org <[email protected]>"
3535

36-
RUN yum install -y centos-release-scl && \
37-
INSTALL_PKGS="libjpeg-turbo libjpeg-turbo-devel python27 python27-python-devel python27-python-setuptools \
38-
python27-python-pip nss_wrapper httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb \
39-
httpd24-mod_ldap httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
40-
yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus $INSTALL_PKGS && \
36+
RUN INSTALL_PKGS="libjpeg-turbo libjpeg-turbo-devel python27 python27-python-devel python27-python-setuptools \
37+
python27-python-pip nss_wrapper httpd24 httpd24-httpd-devel httpd24-mod_ssl \
38+
httpd24-mod_auth_kerb httpd24-mod_ldap httpd24-mod_session atlas-devel gcc-gfortran \
39+
libffi-devel libtool-ltdl enchant" && \
40+
yum install -y centos-release-scl && \
41+
yum -y --setopt=tsflags=nodocs install --enablerepo=centosplus $INSTALL_PKGS && \
4142
rpm -V $INSTALL_PKGS && \
42-
# Remove centos-logos (httpd dependency, ~20MB of graphics) to keep image
43-
# size smaller.
43+
# Remove centos-logos (httpd dependency) to keep image size smaller.
4444
rpm -e --nodeps centos-logos && \
45-
yum clean all -y
45+
yum -y clean all --enablerepo='*'
4646

4747
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
4848
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

2.7/Dockerfile.rhel7

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ LABEL summary="$SUMMARY" \
3333
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=2.7/test/setup-test-app/ rhscl/python-27-rhel7 python-sample-app" \
3434
maintainer="SoftwareCollections.org <[email protected]>"
3535

36-
RUN yum install -y yum-utils && \
37-
prepare-yum-repositories rhel-server-rhscl-7-rpms && \
38-
INSTALL_PKGS="python27 python27-python-devel python27-python-setuptools python27-python-pip \
39-
nss_wrapper httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
36+
RUN INSTALL_PKGS="python27 python27-python-devel python27-python-setuptools python27-python-pip nss_wrapper \
37+
httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
4038
httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
41-
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
39+
yum install -y yum-utils && \
40+
prepare-yum-repositories rhel-server-rhscl-7-rpms && \
41+
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
4242
rpm -V $INSTALL_PKGS && \
4343
# Remove redhat-logos (httpd dependency) to keep image size smaller.
4444
rpm -e --nodeps redhat-logos && \
45-
yum clean all -y
45+
yum -y clean all --enablerepo='*'
4646

4747
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
4848
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

3.4/Dockerfile

+6-7
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ LABEL summary="$SUMMARY" \
3333
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.4/test/setup-test-app/ centos/python-34-centos7 python-sample-app" \
3434
maintainer="SoftwareCollections.org <[email protected]>"
3535

36-
RUN yum install -y centos-release-scl && \
37-
INSTALL_PKGS="rh-python34 rh-python34-python-devel rh-python34-python-setuptools rh-python34-python-pip \
38-
nss_wrapper httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
36+
RUN INSTALL_PKGS="rh-python34 rh-python34-python-devel rh-python34-python-setuptools rh-python34-python-pip nss_wrapper \
37+
httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
3938
httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
40-
yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus $INSTALL_PKGS && \
39+
yum install -y centos-release-scl && \
40+
yum -y --setopt=tsflags=nodocs install --enablerepo=centosplus $INSTALL_PKGS && \
4141
rpm -V $INSTALL_PKGS && \
42-
# Remove centos-logos (httpd dependency, ~20MB of graphics) to keep image
43-
# size smaller.
42+
# Remove centos-logos (httpd dependency) to keep image size smaller.
4443
rpm -e --nodeps centos-logos && \
45-
yum clean all -y
44+
yum -y clean all --enablerepo='*'
4645

4746
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
4847
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

3.4/Dockerfile.rhel7

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ LABEL summary="$SUMMARY" \
3333
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.4/test/setup-test-app/ rhscl/python-34-rhel7 python-sample-app" \
3434
maintainer="SoftwareCollections.org <[email protected]>"
3535

36-
RUN yum install -y yum-utils && \
36+
RUN INSTALL_PKGS="rh-python34 rh-python34-python-devel rh-python34-python-setuptools rh-python34-python-pip nss_wrapper \
37+
httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
38+
httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
39+
yum install -y yum-utils && \
3740
prepare-yum-repositories rhel-server-rhscl-7-rpms && \
38-
INSTALL_PKGS="rh-python34 rh-python34-python-devel rh-python34-python-setuptools rh-python34-python-pip nss_wrapper httpd24 \
39-
httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap httpd24-mod_session \
40-
atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
41-
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
41+
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
4242
rpm -V $INSTALL_PKGS && \
4343
# Remove redhat-logos (httpd dependency) to keep image size smaller.
4444
rpm -e --nodeps redhat-logos && \
45-
yum clean all -y
45+
yum -y clean all --enablerepo='*'
4646

4747
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
4848
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

3.5/Dockerfile

+7-9
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ LABEL summary="$SUMMARY" \
3333
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.5/test/setup-test-app/ centos/python-35-centos7 python-sample-app" \
3434
maintainer="SoftwareCollections.org <[email protected]>"
3535

36-
RUN yum install -y centos-release-scl-rh && \
37-
yum-config-manager --enable centos-sclo-rh-testing && \
38-
INSTALL_PKGS="rh-python35 rh-python35-python-devel rh-python35-python-setuptools rh-python35-python-pip \
39-
nss_wrapper httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
40-
httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
41-
yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus $INSTALL_PKGS && \
36+
RUN INSTALL_PKGS="rh-python35 rh-python35-python-devel rh-python35-python-setuptools rh-python35-python-pip nss_wrapper \
37+
httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
38+
httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
39+
yum install -y centos-release-scl && \
40+
yum -y --setopt=tsflags=nodocs install --enablerepo=centosplus $INSTALL_PKGS && \
4241
rpm -V $INSTALL_PKGS && \
43-
# Remove centos-logos (httpd dependency, ~20MB of graphics) to keep image
44-
# size smaller.
42+
# Remove centos-logos (httpd dependency) to keep image size smaller.
4543
rpm -e --nodeps centos-logos && \
46-
yum clean all -y
44+
yum -y clean all --enablerepo='*'
4745

4846
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
4947
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

3.5/Dockerfile.rhel7

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ LABEL summary="$SUMMARY" \
3333
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.5/test/setup-test-app/ rhscl/python-35-rhel7 python-sample-app" \
3434
maintainer="SoftwareCollections.org <[email protected]>"
3535

36-
RUN yum install -y yum-utils && \
36+
RUN INSTALL_PKGS="rh-python35 rh-python35-python-devel rh-python35-python-setuptools rh-python35-python-pip nss_wrapper \
37+
httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
38+
httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
39+
yum install -y yum-utils && \
3740
prepare-yum-repositories rhel-server-rhscl-7-rpms && \
38-
INSTALL_PKGS="rh-python35 rh-python35-python-devel rh-python35-python-setuptools rh-python35-python-pip \
39-
nss_wrapper httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap httpd24-mod_session \
40-
atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
41-
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
41+
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
4242
rpm -V $INSTALL_PKGS && \
4343
# Remove redhat-logos (httpd dependency) to keep image size smaller.
4444
rpm -e --nodeps redhat-logos && \
45-
yum clean all -y
45+
yum -y clean all --enablerepo='*'
4646

4747
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
4848
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

3.6/Dockerfile

+7-9
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ LABEL summary="$SUMMARY" \
3333
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.6/test/setup-test-app/ centos/python-36-centos7 python-sample-app" \
3434
maintainer="SoftwareCollections.org <[email protected]>"
3535

36-
RUN yum install -y centos-release-scl-rh && \
37-
yum-config-manager --enable centos-sclo-rh-testing && \
38-
INSTALL_PKGS="rh-python36 rh-python36-python-devel rh-python36-python-setuptools rh-python36-python-pip \
39-
nss_wrapper httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
40-
httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
41-
yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus $INSTALL_PKGS && \
36+
RUN INSTALL_PKGS="rh-python36 rh-python36-python-devel rh-python36-python-setuptools rh-python36-python-pip nss_wrapper \
37+
httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
38+
httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
39+
yum install -y centos-release-scl && \
40+
yum -y --setopt=tsflags=nodocs install --enablerepo=centosplus $INSTALL_PKGS && \
4241
rpm -V $INSTALL_PKGS && \
43-
# Remove centos-logos (httpd dependency, ~20MB of graphics) to keep image
44-
# size smaller.
42+
# Remove centos-logos (httpd dependency) to keep image size smaller.
4543
rpm -e --nodeps centos-logos && \
46-
yum clean all -y
44+
yum -y clean all --enablerepo='*'
4745

4846
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
4947
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

3.6/Dockerfile.fedora

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ LABEL summary="$SUMMARY" \
4141
maintainer="SoftwareCollections.org <[email protected]>"
4242

4343
RUN INSTALL_PKGS="python3 python3-devel python3-setuptools python3-pip python3-virtualenv \
44-
nss_wrapper httpd httpd-devel atlas-devel gcc-gfortran libffi-devel libtool-ltdl \
45-
enchant" && \
46-
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
44+
nss_wrapper httpd httpd-devel atlas-devel gcc-gfortran \
45+
libffi-devel libtool-ltdl enchant" && \
46+
dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
4747
rpm -V $INSTALL_PKGS && \
48-
dnf clean all -y
48+
dnf -y clean all --enablerepo='*'
4949

5050
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
5151
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

3.6/Dockerfile.rhel7

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ LABEL summary="$SUMMARY" \
3333
usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.6/test/setup-test-app/ rhscl/python-36-rhel7 python-sample-app" \
3434
maintainer="SoftwareCollections.org <[email protected]>"
3535

36-
RUN yum install -y yum-utils && \
36+
RUN INSTALL_PKGS="rh-python36 rh-python36-python-devel rh-python36-python-setuptools rh-python36-python-pip nss_wrapper \
37+
httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap \
38+
httpd24-mod_session atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
39+
yum install -y yum-utils && \
3740
prepare-yum-repositories rhel-server-rhscl-7-rpms && \
38-
INSTALL_PKGS="rh-python36 rh-python36-python-devel rh-python36-python-setuptools rh-python36-python-pip \
39-
nss_wrapper httpd24 httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap httpd24-mod_session \
40-
atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant" && \
41-
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
41+
yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
4242
rpm -V $INSTALL_PKGS && \
4343
# Remove redhat-logos (httpd dependency) to keep image size smaller.
4444
rpm -e --nodeps redhat-logos && \
45-
yum clean all -y
45+
yum -y clean all --enablerepo='*'
4646

4747
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
4848
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ The resulting image can be run using [Docker](http://docker.io).
1010
For more information about using these images with OpenShift, please see the
1111
official [OpenShift Documentation](https://docs.openshift.org/latest/using_images/s2i_images/python.html).
1212

13-
For more information about contributing, see
14-
[the Contribution Guidelines](https://github.com/sclorg/welcome/blob/master/contribution.md).
1513
For more information about concepts used in these container images, see the
1614
[Landing page](https://github.com/sclorg/welcome).
1715

16+
Contributing
17+
---------------
18+
In this repository [distgen](https://github.com/devexp-db/distgen/) > 0.14 is used for generating Dockerfiles. If you'd like update a Dockerfile, please make changes in specs/multispec.yml and/or templates under src/ (or other distgen file) and run `make generate-all`.
19+
20+
For more information about contributing, see
21+
[the Contribution Guidelines](https://github.com/sclorg/welcome/blob/master/contribution.md).
1822

1923
Versions
2024
---------------

manifest.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Manifest for Dockerfiles creation
2+
# every dest path will be prefixed by $DESTDIR/$version
3+
4+
DISTGEN_MULTI_RULES="
5+
src=src/Dockerfile.template
6+
dest=Dockerfile;
7+
8+
src=src/Dockerfile.template
9+
dest=Dockerfile.rhel7;
10+
11+
src=src/Dockerfile.template
12+
dest=Dockerfile.fedora
13+
"

specs/multispec.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
version: 1
2+
3+
specs:
4+
distroinfo:
5+
centos:
6+
distros:
7+
- centos-7-x86_64
8+
s2i_base: centos/s2i-base-centos7
9+
org: "centos"
10+
prod: "centos7"
11+
logos: "centos-logos"
12+
enablerepo: "--enablerepo=centosplus"
13+
preinstall_cmd: ['yum install -y centos-release-scl']
14+
python_pkgs: ['{{ spec.scl }}', '{{ spec.scl }}-python-devel',
15+
'{{ spec.scl }}-python-setuptools', '{{ spec.scl }}-python-pip']
16+
base_pkgs: ['nss_wrapper', 'httpd24', 'httpd24-httpd-devel', 'httpd24-mod_ssl',
17+
'httpd24-mod_auth_kerb', 'httpd24-mod_ldap', 'httpd24-mod_session',
18+
'atlas-devel', 'gcc-gfortran', 'libffi-devel', 'libtool-ltdl enchant']
19+
extra_pkgs:
20+
- version: "2.7"
21+
value: ['libjpeg-turbo', 'libjpeg-turbo-devel']
22+
23+
rhel:
24+
distros:
25+
- rhel-7-x86_64
26+
s2i_base: rhscl/s2i-base-rhel7
27+
org: "rhscl"
28+
prod: "rhel7"
29+
logos: "redhat-logos"
30+
python3_component_prefix: "rh-"
31+
preinstall_cmd: ['yum install -y yum-utils',
32+
'prepare-yum-repositories rhel-server-rhscl-7-rpms']
33+
python_pkgs: ['{{ spec.scl }}', '{{ spec.scl }}-python-devel',
34+
'{{ spec.scl }}-python-setuptools', '{{ spec.scl }}-python-pip']
35+
base_pkgs: ['nss_wrapper', 'httpd24', 'httpd24-httpd-devel', 'httpd24-mod_ssl',
36+
'httpd24-mod_auth_kerb', 'httpd24-mod_ldap', 'httpd24-mod_session',
37+
'atlas-devel', 'gcc-gfortran', 'libffi-devel', 'libtool-ltdl enchant']
38+
39+
fedora:
40+
distros:
41+
- fedora-27-x86_64
42+
s2i_base: registry.fedoraproject.org/f27/s2i-base
43+
img_tag: "latest"
44+
python_pkgs: ['python3', 'python3-devel', 'python3-setuptools', 'python3-pip',
45+
'python3-virtualenv']
46+
base_pkgs: ['nss_wrapper', 'httpd', 'httpd-devel', 'atlas-devel', 'gcc-gfortran',
47+
'libffi-devel', 'libtool-ltdl enchant']
48+
49+
version:
50+
"3.6":
51+
version: "3.6"
52+
short_ver: "36"
53+
base_img_version: "1"
54+
python_img_version: "1"
55+
scl: "rh-python36"
56+
57+
"3.5":
58+
version: "3.5"
59+
short_ver: "35"
60+
scl: "rh-python35"
61+
62+
"3.4":
63+
version: "3.4"
64+
short_ver: "34"
65+
scl: "rh-python34"
66+
67+
"2.7":
68+
version: "2.7"
69+
short_ver: "27"
70+
scl: "python27"
71+
72+
matrix:
73+
exclude:
74+
- distros:
75+
- fedora-27-x86_64
76+
version: "2.7"
77+
- distros:
78+
- fedora-27-x86_64
79+
version: "3.4"
80+
- distros:
81+
- fedora-27-x86_64
82+
version: "3.5"

src/Dockerfile.template

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{% import "src/common.tpl" as common with context %}
2+
{% import "src/" + config.os.id + "/macros.tpl" as macros with context %}
3+
{% set ns = namespace(extra_pkgs=[]) %}
4+
{% for item in spec.extra_pkgs %}
5+
{% if spec.version == item.version %}
6+
{% set ns.extra_pkgs = item.value %}
7+
{% endif %}
8+
{% endfor %}
9+
{% if config.os.id == 'rhel' and spec.base_img_version %}
10+
{% set img_tag = spec.base_img_version %}
11+
{% elif spec.img_tag %}
12+
{% set img_tag = spec.img_tag %}
13+
{% endif %}
14+
# This image provides a Python {{ spec.version }} environment you can use to run your Python
15+
# applications.
16+
FROM {{ spec.s2i_base}}{% if img_tag %}:{{ img_tag }}{% endif %}
17+
18+
19+
EXPOSE 8080
20+
21+
ENV PYTHON_VERSION={{ spec.version }} \
22+
PATH=$HOME/.local/bin/:$PATH \
23+
PYTHONUNBUFFERED=1 \
24+
PYTHONIOENCODING=UTF-8 \
25+
LC_ALL=en_US.UTF-8 \
26+
LANG=en_US.UTF-8 \
27+
PIP_NO_CACHE_DIR=off
28+
29+
{{ macros.env_metadata() -}}
30+
ENV SUMMARY="Platform for building and running Python $PYTHON_VERSION applications" \
31+
DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \
32+
building and running various Python $PYTHON_VERSION applications and frameworks. \
33+
Python is an easy to learn, powerful programming language. It has efficient high-level \
34+
data structures and a simple but effective approach to object-oriented programming. \
35+
Python's elegant syntax and dynamic typing, together with its interpreted nature, \
36+
make it an ideal language for scripting and rapid application development in many areas \
37+
on most platforms."
38+
39+
LABEL summary="$SUMMARY" \
40+
description="$DESCRIPTION" \
41+
io.k8s.description="$DESCRIPTION" \
42+
io.k8s.display-name="Python {{ spec.version }}" \
43+
io.openshift.expose-services="8080:http" \
44+
io.openshift.tags="builder,python,python{{ spec.short_ver }},rh-python{{ spec.short_ver }}" \
45+
{{ macros.labels(spec) }}
46+
RUN INSTALL_PKGS="{{ common.list_pkgs(ns.extra_pkgs + spec.python_pkgs + spec.base_pkgs) -}}
47+
{% if spec.preinstall_cmd %}
48+
{{ common.preinstall_cmd(spec) -}}
49+
{% endif %}
50+
{{ commands.pkginstaller.install([], {'docs': False}) }}{{ common.enablerepo(spec) }} $INSTALL_PKGS && \
51+
rpm -V $INSTALL_PKGS && \
52+
{% if spec.logos %}
53+
# Remove {{ spec.logos }} (httpd dependency) to keep image size smaller.
54+
rpm -e --nodeps {{ spec.logos }} && \
55+
{% endif %}
56+
{{ commands.pkginstaller.cleancache() }}
57+
58+
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
59+
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
60+
61+
# Copy extra files to the image.
62+
COPY ./root/ /
63+
64+
# - Create a Python virtual environment for use by any application to avoid
65+
# potential conflicts with Python packages preinstalled in the main Python
66+
# installation.
67+
# - In order to drop the root user, we have to make some directories world
68+
# writable as OpenShift default security model is to run the container
69+
# under random UID.
70+
{{ macros.permissions_setup(spec) }}
71+
USER 1001
72+
73+
# Set the default CMD to print the usage of the language image.
74+
CMD $STI_SCRIPTS_PATH/usage

0 commit comments

Comments
 (0)