Added composer build
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 57s 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 1m27s 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 1m10s 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 1m15s 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 1m28s 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 1m3s 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 1m0s 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 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:postgresql with_server:apache]) (push) Successful in 58s Details

This commit is contained in:
Muhamad Aditya Prima 2024-12-16 21:09:49 +07:00
parent d81dbc05ce
commit a5c22a4332
2 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,75 @@
# 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"
ARG PHP_VERSION=5.6
ARG PHP_VER_SHORT=5
ARG COMPOSER_VERSION=2.2.25
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
ENV COMPOSER_VERSION=${COMPOSER_VERSION}
# Set composer home
ENV COMPOSER_HOME=/app
ENV COMPOSER_CACHE_DIR=${COMPOSER_HOME}/cache
WORKDIR /root
ADD 5/scripts/alpine-composer-setup.sh /tmp/setup.sh
# Create directory, and install required php app
RUN /bin/mkdir -p ${COMPOSER_HOME}/build ${COMPOSER_CACHE_DIR}/files \
${COMPOSER_CACHE_DIR}/repo ${COMPOSER_CACHE_DIR}/vcs ; \
/usr/sbin/addgroup -g 10001 composer ; \
/usr/sbin/adduser -D -u 10001 -G composer -s /sbin/nologin -h ${COMPOSER_HOME}/build composer ; \
/sbin/apk add --update --no-cache \
php${PHP_VER_SHORT} php${PHP_VER_SHORT}-common \
php${PHP_VER_SHORT}-cli ; \
/bin/chown -R composer:composer /app ${COMPOSER_CACHE_DIR} ; \
/bin/chmod +x /tmp/setup.sh; \
/bin/sh /tmp/setup.sh; \
/bin/rm -f /tmp/*.sh;
# 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
# CLEAN APK CACHES
RUN rm -vrf /var/cache/apk/*
FROM scratch
ARG PHP_VERSION=5.6
ARG PHP_VER_SHORT=5
ARG COMPOSER_VERSION=2.2.25
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
ENV COMPOSER_VERSION=${COMPOSER_VERSION}
# Set composer home
ENV COMPOSER_HOME=/app
ENV COMPOSER_CACHE_DIR=${COMPOSER_HOME}/cache
LABEL maintainer="Muhamad Aditya Prima <map@sindigilive.com>"
LABEL name="composer"
LABEL version="${COMPOSER_VER_SHORT}"
LABEL distribution-scope="public"
#labels for container catalog
LABEL summary="Composer ${COMPOSER_VER_SHORT} with PHP ${PHP_VERSION} on alpine based container image"
LABEL description="Provide php on alpine based container base image"
LABEL io.k8s.description="Very small alpine linux container image"
LABEL io.k8s.display-name="Composer ${COMPOSER_VER_SHORT}, PHP ${PHP_VERSION}"
COPY --from=builder / /
USER composer
WORKDIR ${COMPOSER_HOME}/build
STOPSIGNAL SIGQUIT
CMD ["/usr/bin/composer", "-V"]

View File

@ -0,0 +1,21 @@
#!/bin/sh
PHP_LIST="bcmath,bz2,calendar,cgi,ctype,
curl,dba,dev,doc,
dom,embed,enchant,exif,ftp,
gd,gettext,gmp,iconv,imap,
intl,json,ldap,mailparse,mcrypt,
memcache,opcache,openssl,pcntl,pdo,
pear,pear-net_socket,phar,phpdbg,
phpmailer,posix,pspell,shmop,
snmp,soap,sockets,sysvmsg,sysvsem,
sysvshm,wddx,xcache,xml,xmlreader,
xmlrpc,xsl,zip,zlib"
PHP_DEPS=""
# Setup php flavor
for i in $(echo $PHP_LIST | tr "," "\n"); do
PHP_DEPS="${PHP_DEPS} php$PHP_VER_SHORT-$i ";
done
/sbin/apk add --update --no-cache $PHP_DEPS;