forked from sclorg/s2i-python-container
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (45 loc) · 2.05 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (45 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This image provides a Python 3.3 environment you can use to run your Python
# applications.
FROM openshift/base-centos7
MAINTAINER SoftwareCollections.org <sclorg@redhat.com>
EXPOSE 8080
ENV PYTHON_VERSION=3.3 \
PATH=$HOME/.local/bin/:$PATH \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
PIP_NO_CACHE_DIR=off
LABEL io.k8s.description="Platform for building and running Python 3.3 applications" \
io.k8s.display-name="Python 3.3" \
io.openshift.expose-services="8080:http" \
io.openshift.tags="builder,python,python33"
RUN yum install -y centos-release-scl && \
INSTALL_PKGS="python33 python33-python-devel python33-python-setuptools nss_wrapper httpd24 \
httpd24-httpd-devel httpd24-mod_ssl httpd24-mod_auth_kerb httpd24-mod_ldap httpd24-mod_session \
atlas-devel gcc-gfortran libffi-devel libtool-ltdl" && \
yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
# Remove centos-logos (httpd dependency, ~20MB of graphics) to keep image
# size smaller.
rpm -e --nodeps centos-logos && \
yum clean all -y
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
# Each language image can have 'contrib' a directory with extra files needed to
# run and build the applications.
COPY ./contrib/ /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.
RUN source scl_source enable python33 && \
virtualenv /opt/app-root && \
source /opt/app-root/bin/activate && \
pip install -U pip==1.5.6
# 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 ug+rwx /opt/app-root
USER 1001
# Set the default CMD to print the usage of the language image.
CMD $STI_SCRIPTS_PATH/usage