forked from sclorg/s2i-php-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
79 lines (66 loc) · 3.47 KB
/
Dockerfile
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM centos/s2i-base-centos7
# This image provides an Apache+PHP environment for running PHP
# applications.
EXPOSE 8080
EXPOSE 8443
# Description
# This image provides an Apache 2.4 + PHP 5.6 environment for running PHP applications.
# Exposed ports:
# * 8080 - alternative port for http
ENV PHP_VERSION=5.6 \
PHP_VER_SHORT=56 \
NAME=php \
PATH=$PATH:/opt/rh/rh-php56/root/usr/bin
ENV SUMMARY="Platform for building and running PHP $PHP_VERSION applications" \
DESCRIPTION="PHP $PHP_VERSION available as docker container is a base platform for \
building and running various PHP $PHP_VERSION applications and frameworks. \
PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers \
to write dynamically generated web pages. PHP also offers built-in database integration \
for several commercial and non-commercial database management systems, so writing \
a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding \
is probably as a replacement for CGI scripts."
LABEL summary="${SUMMARY}" \
description="${DESCRIPTION}" \
io.k8s.description="${DESCRIPTION}" \
io.k8s.display-name="Apache 2.4 with PHP ${PHP_VERSION}" \
io.openshift.expose-services="8080:http" \
io.openshift.tags="builder,${NAME},${NAME}${PHP_VER_SHORT},rh-${NAME}${PHP_VER_SHORT}" \
io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \
io.s2i.scripts-url="image:///usr/libexec/s2i" \
name="centos/${NAME}-${PHP_VER_SHORT}-centos7" \
com.redhat.component="rh-${NAME}${PHP_VER_SHORT}-docker" \
version="${PHP_VERSION}" \
help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \
usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=${PHP_VERSION}/test/test-app centos/${NAME}-${PHP_VER_SHORT}-centos7 sample-server" \
maintainer="SoftwareCollections.org <[email protected]>"
# Install Apache httpd and PHP
RUN yum install -y centos-release-scl && \
INSTALL_PKGS="rh-php56 rh-php56-php rh-php56-php-mysqlnd rh-php56-php-pgsql rh-php56-php-bcmath \
rh-php56-php-gd rh-php56-php-intl rh-php56-php-ldap rh-php56-php-mbstring rh-php56-php-pdo \
rh-php56-php-pecl-memcache rh-php56-php-process rh-php56-php-soap rh-php56-php-opcache rh-php56-php-xml \
rh-php56-php-pecl-xdebug rh-php56-php-gmp httpd24-mod_ssl" && \
yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all -y
ENV PHP_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/php/ \
APP_DATA=${APP_ROOT}/src \
PHP_DEFAULT_INCLUDE_PATH=/opt/rh/rh-php56/root/usr/share/pear \
PHP_SYSCONF_PATH=/etc/opt/rh/rh-php56 \
PHP_HTTPD_CONF_FILE=rh-php56-php.conf \
HTTPD_CONFIGURATION_PATH=${APP_ROOT}/etc/conf.d \
HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \
HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \
HTTPD_VAR_RUN=/var/run/httpd \
HTTPD_DATA_PATH=/var/www \
HTTPD_DATA_ORIG_PATH=/opt/rh/httpd24/root/var/www \
HTTPD_VAR_PATH=/opt/rh/httpd24/root/var \
SCL_ENABLED=rh-php56
# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
COPY ./s2i/bin/ $STI_SCRIPTS_PATH
# Copy extra files to the image.
COPY ./root/ /
# Reset permissions of filesystem to default values
RUN /usr/libexec/container-setup && rpm-file-permissions
USER 1001
# Set the default CMD to print the usage of the language image
CMD $STI_SCRIPTS_PATH/usage