Updated php5 alpine
Build and push PHP 5 container images / Build PHP 5 container images (cli, apache, map[os:alpine os_version:3.6 php_ver_short:5 php_version:5.6]) (push) Successful in 1m2s Details
Build and push PHP 5 container images / Build PHP 5 container images (cli, blank, map[os:alpine os_version:3.6 php_ver_short:5 php_version:5.6]) (push) Successful in 54s Details
Build and push PHP 5 container images / Build PHP 5 container images (debug, apache, map[os:alpine os_version:3.6 php_ver_short:5 php_version:5.6]) (push) Successful in 1m13s Details
Build and push PHP 5 container images / Build PHP 5 container images (debug, blank, map[os:alpine os_version:3.6 php_ver_short:5 php_version:5.6]) (push) Successful in 1m14s Details
Build and push PHP 5 container images / Build PHP 5 container images (full, apache, map[os:alpine os_version:3.6 php_ver_short:5 php_version:5.6]) (push) Successful in 1m8s Details
Build and push PHP 5 container images / Build PHP 5 container images (full, blank, map[os:alpine os_version:3.6 php_ver_short:5 php_version:5.6]) (push) Successful in 55s Details

This commit is contained in:
Muhamad Aditya Prima 2024-12-16 19:44:21 +07:00
parent d3e3a8d873
commit d5421aa456
3 changed files with 17 additions and 9 deletions

View File

@ -1,5 +1,5 @@
# PHP 5.6 == 3.5
ARG OS_VERSION=3.5
# PHP 5.6 == 3.6
ARG OS_VERSION=3.6
FROM quay.io/sindigilive/alpine:${OS_VERSION} AS builder
LABEL maintainer="<Muhamad Aditya Prima> map@sindigilive.com"

View File

@ -1,5 +1,5 @@
# PHP 5.6 == 3.5
ARG OS_VERSION=3.5
# PHP 5.6 == 3.6
ARG OS_VERSION=3.6
FROM quay.io/sindigilive/alpine:${OS_VERSION} AS builder
LABEL maintainer="<Muhamad Aditya Prima> map@sindigilive.com"
@ -13,11 +13,12 @@ ENV FLAVOR=${FLAVOR}
ENV WITH_APACHE=${WITH_APACHE}
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
ENV SERVER_ROOT=/app
WORKDIR /root
ADD 5/scripts/alpine-setup.sh /tmp/setup.sh
ADD scripts/entrypoint.sh /usr/local/bin
ADD scripts/entrypoint.sh /usr/local/bin/
# Create directory, and install required php app
RUN /bin/mkdir -p /app ; \
@ -28,7 +29,7 @@ RUN /bin/mkdir -p /app ; \
/bin/sh /tmp/setup.sh; \
/bin/rm -f /tmp/*.sh;
ADD htdocs /app/htdocs
ADD htdocs ${SERVER_ROOT}/htdocs
# Create symlinks to /usr/bin/php in case it doesn't exists
RUN ln -ns /usr/bin/php${PHP_VER_SHORT} /usr/bin/php ; exit 0
@ -37,7 +38,10 @@ RUN ln -ns /usr/bin/php${PHP_VER_SHORT} /usr/bin/php ; exit 0
RUN sed -i "s|#version#|${PHP_VERSION}|" /app/htdocs/index.html ; \
sed -i "s|#os#|alpine|" /app/htdocs/index.html ; \
sed -i "s|#flavor#|${FLAVOR}|" /app/htdocs/index.html ; \
chown apache:apache /app/htdocs; \
mkdir -p ${SERVER_ROOT}/logs ${SERVER_ROOT}/run /run/apache2 ; \
ln -s /usr/lib/apache2 ${SERVER_ROOT}/modules ; \
chmod -R 755 ${SERVER_ROOT}/logs ${SERVER_ROOT/run} ; \
chown -R apache:apache ${SERVER_ROOT}/htdocs ${SERVER_ROOT}/logs ${SERVER_ROOT}/run /run/apache2 ; \
rm -vrf /var/cache/apk/*
FROM scratch
@ -61,7 +65,9 @@ LABEL io.k8s.display-name="PHP ${PHP_VERSION}"
COPY --from=builder / /
WORKDIR /app
USER apache
WORKDIR /app/htdocs
STOPSIGNAL SIGQUIT

View File

@ -37,7 +37,7 @@ if [ "$WITH_APACHE" == "true" ]; then
if [ "$FLAVOR" == "full" ] || [ "$FLAVOR" == "debug" ]; then
/usr/sbin/addgroup -g 10001 apache ;
/usr/sbin/adduser -D -u 10001 -G apache -s /bin/sh -h $APP_ROOT apache ;
/sbin/apk add --update --no-cache apache2 php$PHP_VER_SHORT-apache2;
/sbin/apk add --update --no-cache apache2 php$PHP_VER_SHORT-apache2 ;
sed -i "s|ServerRoot /var/www|ServerRoot ${SERVER_ROOT}|" /etc/apache2/httpd.conf ;
sed -i "s|ServerAdmin you@example.com| ServerAdmin map@sindigilive.com|" /etc/apache2/httpd.conf ;
@ -50,7 +50,9 @@ if [ "$WITH_APACHE" == "true" ]; then
sed -i "s|#LoadModule rewrite_module|LoadModule rewrite_module|" /etc/apache2/httpd.conf ;
sed -i "s|#LoadModule deflate_module|LoadModule deflate_module|" /etc/apache2/httpd.conf ;
sed -i "s|#LoadModule expires_module|LoadModule expires_module|" /etc/apache2/httpd.conf ;
sed -i "s|/var/www/localhost/cgi-bin/|/app/cgi-bin/|" /etc/apache2/httpd.conf ;
sed -i "s|Require host .example.com|#Require host .example.com|" /etc/apache2/conf.d/info.conf ;
sed -i "s|Require ip 127|Require all granted|" /etc/apache2/conf.d/info.conf ;
sed -i "s|/run/apache2/httpd.pid|${SERVER_ROOT}/run/httpd.pid|" /etc/apache2/conf.d/mpm.conf ;
fi
fi