forked from sclorg/s2i-php-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.fedora
81 lines (67 loc) · 3.04 KB
/
Dockerfile.fedora
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
80
81
FROM quay.io/fedora/s2i-base:37
# This image provides an Apache+PHP environment for running PHP
# applications.
EXPOSE 8080
EXPOSE 8443
ENV PHP_VERSION=8.1 \
PHP_SHORT_VER=81 \
PATH=$PATH:/usr/bin
ENV SUMMARY="Platform for building and running PHP $PHP_VERSION applications" \
DESCRIPTION="PHP $PHP_VERSION available as 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."
ENV NAME=php \
VERSION=0 \
RELEASE=1 \
ARCH=x86_64
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,php" \
name="fedora/$NAME-$PHP_SHORT_VER" \
com.redhat.component="$NAME" \
version="$VERSION" \
usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=/$PHP_VERSION/test/test-app quay.io/fedora/$NAME-$PHP_SHORT_VER sample-server" \
maintainer="SoftwareCollections.org <[email protected]>"
# Install Apache httpd and PHP
ARG INSTALL_PKGS="php php-fpm php-mysqlnd php-bcmath \
php-gd php-intl php-ldap php-mbstring php-pdo \
php-process php-soap php-opcache php-xml \
php-gmp php-pecl-apcu mod_ssl hostname"
RUN yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS --nogpgcheck && \
rpm -V $INSTALL_PKGS && \
php -v | grep -qe "v$PHP_VERSION\." && echo "Found VERSION $PHP_VERSION" && \
yum -y clean all --enablerepo='*'
ENV PHP_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/php/ \
APP_DATA=${APP_ROOT}/src \
PHP_DEFAULT_INCLUDE_PATH=/usr/share/pear \
PHP_SYSCONF_PATH=/etc \
PHP_HTTPD_CONF_FILE=php.conf \
PHP_FPM_CONF_D_PATH=/etc/php-fpm.d \
PHP_FPM_CONF_FILE=www.conf \
PHP_FPM_RUN_DIR=/run/php-fpm \
PHP_MAIN_FPM_CONF_FILE=/etc/php-fpm.conf \
PHP_FPM_LOG_PATH=/var/log/php-fpm \
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_MODULES_CONF_D_PATH=/etc/httpd/conf.modules.d \
HTTPD_VAR_RUN=/var/run/httpd \
HTTPD_DATA_PATH=/var/www \
HTTPD_DATA_ORIG_PATH=/var/www \
HTTPD_VAR_PATH=/var
# 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