Composer now available on all images
Build and push PHP 5 container images / Build PHP 5 container images (map[mode:cli os:alpine os_version:3.6 php_ver_short:5 php_version:5.6 with_database:false with_server:false]) (push) Successful in 51s Details
Build and push PHP 5 container images / Build PHP 5 container images (map[mode:debug os:alpine os_version:3.6 php_ver_short:5 php_version:5.6 with_database:false with_server:apache]) (push) Successful in 1m26s Details
Build and push PHP 5 container images / Build PHP 5 container images (map[mode:debug os:alpine os_version:3.6 php_ver_short:5 php_version:5.6 with_database:false with_server:false]) (push) Successful in 1m22s Details
Build and push PHP 5 container images / Build PHP 5 container images (map[mode:debug os:alpine os_version:3.6 php_ver_short:5 php_version:5.6 with_database:mysql with_server:apache]) (push) Successful in 1m30s Details
Build and push PHP 5 container images / Build PHP 5 container images (map[mode:debug os:alpine os_version:3.6 php_ver_short:5 php_version:5.6 with_database:postgresql with_server:apache]) (push) Successful in 1m32s Details
Build and push PHP 5 container images / Build PHP 5 container images (map[mode:full os:alpine os_version:3.6 php_ver_short:5 php_version:5.6 with_database:false with_server:apache]) (push) Successful in 1m20s Details
Build and push PHP 5 container images / Build PHP 5 container images (map[mode:full os:alpine os_version:3.6 php_ver_short:5 php_version:5.6 with_database:false with_server:false]) (push) Successful in 1m9s Details
Build and push PHP 5 container images / Build PHP 5 container images (map[mode:full os:alpine os_version:3.6 php_ver_short:5 php_version:5.6 with_database:mysql with_server:apache]) (push) Successful in 1m18s Details
Build and push PHP 5 container images / Build PHP 5 container images (map[mode:full os:alpine os_version:3.6 php_ver_short:5 php_version:5.6 with_database:postgresql with_server:apache]) (push) Successful in 1m24s Details

This commit is contained in:
Muhamad Aditya Prima 2024-12-18 01:49:00 +07:00
parent 79741d89b9
commit d12dee4fce
2 changed files with 23 additions and 7 deletions

View File

@ -9,23 +9,39 @@ ARG WITH_APACHE=false
ARG WITH_DATABASE=false
ARG PHP_VERSION=5.6
ARG PHP_VER_SHORT=5
ARG COMPOSER_VERSION=2.2.25
ARG COMPOSER_VER_SHORT=2.2
ENV FLAVOR=${FLAVOR}
ENV WITH_APACHE=${WITH_APACHE}
ENV WITH_DATABASE=${WITH_DATABASE}
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
ENV COMPOSER_VERSION=${COMPOSER_VERSION}
ENV COMPOSER_VER_SHORT=${COMPOSER_VER_SHORT}
WORKDIR /root
# Set composer home
ENV COMPOSER_HOME=/app
ENV COMPOSER_CACHE_DIR=${COMPOSER_HOME}/cache
ADD 5/scripts/alpine-setup.sh /tmp/setup.sh
WORKDIR /tmp
ADD 5/scripts/alpine-setup.sh ./setup.sh
# Download and install composer
ADD https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar /usr/local/bin/composer
# Create directory, and install required php app
RUN /bin/mkdir -p /app ; \
RUN /bin/mkdir -p ${COMPOSER_HOME}/build ${COMPOSER_CACHE_DIR}/files \
${COMPOSER_CACHE_DIR}/repo ${COMPOSER_CACHE_DIR}/vcs ; \
/app ; \
/usr/sbin/addgroup -g 10001 php ; \
/usr/sbin/adduser -D -u 10001 -G php -s /sbin/nologin -h ${COMPOSER_HOME}/build php ; \
/bin/mkdir -p /app ; \
/sbin/apk add --update --no-cache \
php${PHP_VER_SHORT} php${PHP_VER_SHORT}-common \
php${PHP_VER_SHORT}-cli ; \
/bin/chmod +x /tmp/setup.sh; \
php${PHP_VER_SHORT}-cli php${PHP_VER_SHORT}-phar ; \
/bin/chmod +x /tmp/setup.sh /usr/local/bin/composer ; \
/bin/sh /tmp/setup.sh; \
/bin/rm -f /tmp/*.sh;

View File

@ -35,8 +35,8 @@ fi
# Only setup apache with full flavor parameters
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 ;
/usr/sbin/addgroup -g 10002 apache ;
/usr/sbin/adduser -D -u 10002 -G apache -s /sbin/nologin -h $APP_ROOT apache ;
/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 ;