Updated php7 dockerfile and workflows
Build and push PHP 7 container images / Build PHP 7 builder container images (map[os:alpine os_version:3.12 php_ver_short:7 php_version:7.3]) (push) Successful in 44s Details
Build and push PHP 7 container images / Build PHP 7 builder container images (map[os:alpine os_version:3.15 php_ver_short:7 php_version:7.4]) (push) Successful in 48s Details
Build and push PHP 7 container images / Build PHP 7 builder container images (map[os:alpine os_version:3.9 php_ver_short:7 php_version:7.2]) (push) Successful in 46s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.12 php_ver_short:7 php_version:7.3 with_database:false with_server:apache]) (push) Successful in 1m16s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.12 php_ver_short:7 php_version:7.3 with_database:false with_server:false]) (push) Successful in 1m5s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.12 php_ver_short:7 php_version:7.3 with_database:mysql with_server:apache]) (push) Successful in 1m8s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.12 php_ver_short:7 php_version:7.3 with_database:postgresql with_server:apache]) (push) Successful in 1m9s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.15 php_ver_short:7 php_version:7.4 with_database:false with_server:apache]) (push) Successful in 1m28s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.15 php_ver_short:7 php_version:7.4 with_database:false with_server:false]) (push) Successful in 1m6s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.15 php_ver_short:7 php_version:7.4 with_database:mysql with_server:apache]) (push) Successful in 1m13s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.15 php_ver_short:7 php_version:7.4 with_database:postgresql with_server:apache]) (push) Successful in 1m12s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.9 php_ver_short:7 php_version:7.2 with_database:false with_server:apache]) (push) Successful in 1m14s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.9 php_ver_short:7 php_version:7.2 with_database:false with_server:false]) (push) Successful in 1m9s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.9 php_ver_short:7 php_version:7.2 with_database:mysql with_server:apache]) (push) Successful in 1m6s Details
Build and push PHP 7 container images / Build PHP 7 container images (map[os:alpine os_version:3.9 php_ver_short:7 php_version:7.2 with_database:postgresql with_server:apache]) (push) Successful in 1m8s Details

This commit is contained in:
Muhamad Aditya Prima 2024-12-27 14:26:33 +07:00
parent 419e20226b
commit 485687363b
4 changed files with 152 additions and 248 deletions

View File

@ -51,177 +51,144 @@ jobs:
PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }}
tags: | tags: |
quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-builder-${{ matrix.flavors.os }} quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-builder-${{ matrix.flavors.os }}
# flavors: flavors:
# name: Build PHP 7 container images name: Build PHP 7 container images
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# container: needs:
# image: ghcr.io/catthehacker/ubuntu:act-latest - builder
# strategy: container:
# matrix: image: ghcr.io/catthehacker/ubuntu:act-latest
# flavors: strategy:
# - os: "alpine" matrix:
# os_version: "3.15" flavors:
# php_version: "7.4" - os: "alpine"
# php_ver_short: "7" os_version: "3.9"
# mode: cli php_version: "7.2"
# with_server: "false" php_ver_short: "7"
# with_database: "false" with_server: "false"
# - os: "alpine" with_database: "false"
# os_version: "3.15" - os: "alpine"
# php_version: "7.4" os_version: "3.12"
# php_ver_short: "7" php_version: "7.3"
# mode: full php_ver_short: "7"
# with_server: "false" with_server: "false"
# with_database: "false" with_database: "false"
# - os: "alpine" - os: "alpine"
# os_version: "3.15" os_version: "3.15"
# php_version: "7.4" php_version: "7.4"
# php_ver_short: "7" php_ver_short: "7"
# mode: full with_server: "false"
# with_server: "apache" with_database: "false"
# with_database: "false"
# - os: "alpine"
# os_version: "3.15"
# php_version: "7.4"
# php_ver_short: "7"
# mode: full
# with_server: "apache"
# with_database: "mysql"
# - os: "alpine"
# os_version: "3.15"
# php_version: "7.4"
# php_ver_short: "7"
# mode: full
# with_server: "apache"
# with_database: "postgresql"
# - os: "alpine"
# os_version: "3.12"
# php_version: "7.3"
# php_ver_short: "7"
# mode: cli
# with_server: "false"
# with_database: "false"
# - os: "alpine"
# os_version: "3.12"
# php_version: "7.3"
# php_ver_short: "7"
# mode: full
# with_server: "false"
# with_database: "false"
# - os: "alpine"
# os_version: "3.12"
# php_version: "7.3"
# php_ver_short: "7"
# mode: full
# with_server: "apache"
# with_database: "false"
# - os: "alpine"
# os_version: "3.12"
# php_version: "7.3"
# php_ver_short: "7"
# mode: full
# with_server: "apache"
# with_database: "mysql"
# - os: "alpine"
# os_version: "3.12"
# php_version: "7.3"
# php_ver_short: "7"
# mode: full
# with_server: "apache"
# with_database: "postgresql"
# - os: "alpine" - os: "alpine"
# os_version: "3.9" os_version: "3.9"
# php_version: "7.2" php_version: "7.2"
# php_ver_short: "7" php_ver_short: "7"
# mode: cli with_server: "apache"
# with_server: "false" with_database: "false"
# with_database: "false" - os: "alpine"
# - os: "alpine" os_version: "3.12"
# os_version: "3.9" php_version: "7.3"
# php_version: "7.2" php_ver_short: "7"
# php_ver_short: "7" with_server: "apache"
# mode: full with_database: "false"
# with_server: "false" - os: "alpine"
# with_database: "false" os_version: "3.15"
# - os: "alpine" php_version: "7.4"
# os_version: "3.9" php_ver_short: "7"
# php_version: "7.2" with_server: "apache"
# php_ver_short: "7" with_database: "false"
# mode: full
# with_server: "apache"
# with_database: "false"
# - os: "alpine"
# os_version: "3.9"
# php_version: "7.2"
# php_ver_short: "7"
# mode: full
# with_server: "apache"
# with_database: "mysql"
# - os: "alpine"
# os_version: "3.9"
# php_version: "7.2"
# php_ver_short: "7"
# mode: full
# with_server: "apache"
# with_database: "postgresql"
# steps: - os: "alpine"
# - name: Check out repository code os_version: "3.9"
# uses: actions/checkout@v4 php_version: "7.2"
# - name: Login to quay.io php_ver_short: "7"
# uses: docker/login-action@v3 with_server: "apache"
# with: with_database: "mysql"
# registry: quay.io - os: "alpine"
# username: ${{ vars.QUAY_USERNAME }} os_version: "3.12"
# password: ${{ secrets.QUAY_SECRET }} php_version: "7.3"
# # - name: Set up QEMU php_ver_short: "7"
# # uses: docker/setup-qemu-action@v3 with_server: "apache"
# - name: Setup Docker buildx with_database: "mysql"
# uses: docker/setup-buildx-action@v3 - os: "alpine"
# - if: ${{ matrix.flavors.with_server == 'false' && matrix.flavors.with_database == 'false' }} os_version: "3.15"
# name: Build and push php7 php_version: "7.4"
# uses: docker/build-push-action@v5 php_ver_short: "7"
# with: with_server: "apache"
# push: true with_database: "mysql"
# context: .
# file: 7/Dockerfile.${{ matrix.flavors.os }} - os: "alpine"
# build-args: | os_version: "3.9"
# OS_VERSION=${{ matrix.flavors.os_version }} php_version: "7.2"
# FLAVOR=${{ matrix.flavors.mode }} php_ver_short: "7"
# PHP_VERSION=${{ matrix.flavors.php_version }} with_server: "apache"
# PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} with_database: "postgresql"
# tags: | - os: "alpine"
# quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.mode }}-${{ matrix.flavors.os }} os_version: "3.12"
# - if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database == 'false' }} php_version: "7.3"
# name: Build and push php7 with webserver php_ver_short: "7"
# uses: docker/build-push-action@v5 with_server: "apache"
# with: with_database: "postgresql"
# push: true - os: "alpine"
# context: . os_version: "3.15"
# file: 7/Dockerfile.${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }} php_version: "7.4"
# build-args: | php_ver_short: "7"
# OS_VERSION=${{ matrix.flavors.os_version }} with_server: "apache"
# FLAVOR=${{ matrix.flavors.mode }} with_database: "postgresql"
# PHP_VERSION=${{ matrix.flavors.php_version }}
# PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} steps:
# WITH_APACHE=true - name: Check out repository code
# tags: | uses: actions/checkout@v4
# quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.mode }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }} - name: Login to quay.io
# - if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database != 'false' }} uses: docker/login-action@v3
# name: Build and push php7 with apache2 and database connector library with:
# uses: docker/build-push-action@v5 registry: quay.io
# with: username: ${{ vars.QUAY_USERNAME }}
# push: true password: ${{ secrets.QUAY_SECRET }}
# context: . # - name: Set up QEMU
# file: 7/Dockerfile.${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }} # uses: docker/setup-qemu-action@v3
# build-args: | - name: Setup Docker buildx
# OS_VERSION=${{ matrix.flavors.os_version }} uses: docker/setup-buildx-action@v3
# FLAVOR=${{ matrix.flavors.mode }} - if: ${{ matrix.flavors.with_server == 'false' && matrix.flavors.with_database == 'false' }}
# PHP_VERSION=${{ matrix.flavors.php_version }} name: Build and push php7
# PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} uses: docker/build-push-action@v5
# WITH_APACHE=true with:
# WITH_DATABASE=${{ matrix.flavors.with_database }} push: true
# tags: | context: .
# quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.mode }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.with_database }}-${{ matrix.flavors.os }} file: 7/Dockerfile.${{ matrix.flavors.os }}
build-args: |
OS_VERSION=${{ matrix.flavors.os_version }}
PHP_VERSION=${{ matrix.flavors.php_version }}
PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }}
tags: |
quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.os }}
- if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database == 'false' }}
name: Build and push php7 with webserver
uses: docker/build-push-action@v5
with:
push: true
context: .
file: 7/Dockerfile.${{ matrix.flavors.os }}-${{ matrix.flavors.with_server }}
build-args: |
OS_VERSION=${{ matrix.flavors.os_version }}
PHP_VERSION=${{ matrix.flavors.php_version }}
PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }}
WITH_APACHE=true
tags: |
quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }}
- if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database != 'false' }}
name: Build and push php7 with webserver and database connector library
uses: docker/build-push-action@v5
with:
push: true
context: .
file: 7/Dockerfile.${{ matrix.flavors.os }}-${{ matrix.flavors.with_server }}
build-args: |
OS_VERSION=${{ matrix.flavors.os_version }}
PHP_VERSION=${{ matrix.flavors.php_version }}
PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }}
WITH_APACHE=true
WITH_DATABASE=${{ matrix.flavors.with_database }}
tags: |
quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.with_database }}-${{ matrix.flavors.os }}

View File

@ -2,49 +2,25 @@
# PHP 7.3 == 3.12 # PHP 7.3 == 3.12
# PHP 7.4 == 3.15 # PHP 7.4 == 3.15
ARG OS_VERSION=3.15 ARG OS_VERSION=3.15
ARG PHP_VERSION=7.4
FROM quay.io/sindigilive/alpine:${OS_VERSION} AS builder FROM quay.io/sindigilive/php:${PHP_VERSION}-builder-alpine AS builder
LABEL maintainer="<Muhamad Aditya Prima> map@sindigilive.com"
ARG FLAVOR=cli
ARG WITH_APACHE=false ARG WITH_APACHE=false
ARG WITH_DATABASE=false ARG WITH_DATABASE=false
ARG PHP_VERSION=7.4
ARG PHP_VER_SHORT=7
ARG COMPOSER_VERSION=2.8.4
ENV FLAVOR=${FLAVOR}
ENV WITH_APACHE=${WITH_APACHE} ENV WITH_APACHE=${WITH_APACHE}
ENV WITH_DATABASE=${WITH_DATABASE} ENV WITH_DATABASE=${WITH_DATABASE}
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
ENV COMPOSER_VERSION=${COMPOSER_VERSION}
WORKDIR /root
ADD 7/scripts/alpine-setup.sh /tmp/setup.sh
ADD https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar /usr/local/bin/composer
# Create directory, and install required php app # Create directory, and install required php app
RUN /bin/mkdir -p /app ; \ RUN /bin/sh /tmp/setup.sh; \
/sbin/apk add --update --no-cache \ /bin/rm -f /tmp/*.sh; \
php${PHP_VER_SHORT} php${PHP_VER_SHORT}-common \ rm -vrf /var/cache/apk/*
php${PHP_VER_SHORT}-cli php${PHP_VER_SHORT}-phar \
php${PHP_VER_SHORT}-iconv php${PHP_VER_SHORT}-mbstring ; \
/bin/chmod +x /tmp/setup.sh /usr/local/bin/composer ; \
/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 FROM scratch
ARG PHP_VERSION=5.6 ARG PHP_VERSION=7.4
ARG PHP_VER_SHORT=5 ARG PHP_VER_SHORT=7
ENV PHP_VERSION=${PHP_VERSION} ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT} ENV PHP_VER_SHORT=${PHP_VER_SHORT}

View File

@ -2,60 +2,25 @@
# PHP 7.3 == 3.12 # PHP 7.3 == 3.12
# PHP 7.4 == 3.15 # PHP 7.4 == 3.15
ARG OS_VERSION=3.15 ARG OS_VERSION=3.15
ARG PHP_VERSION=7.4
FROM quay.io/sindigilive/alpine:${OS_VERSION} AS builder FROM quay.io/sindigilive/php:${PHP_VERSION}-builder-alpine AS builder
LABEL maintainer="<Muhamad Aditya Prima> map@sindigilive.com"
ARG FLAVOR=cli
ARG WITH_APACHE=false ARG WITH_APACHE=false
ARG WITH_DATABASE=false ARG WITH_DATABASE=false
ARG PHP_VERSION=7.4
ARG PHP_VER_SHORT=7
ARG COMPOSER_VERSION=2.8.4
ENV FLAVOR=${FLAVOR}
ENV WITH_APACHE=${WITH_APACHE} ENV WITH_APACHE=${WITH_APACHE}
ENV WITH_DATABASE=${WITH_DATABASE} ENV WITH_DATABASE=${WITH_DATABASE}
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
ENV SERVER_ROOT=/app
ENV COMPOSER_VERSION=${COMPOSER_VERSION}
WORKDIR /root
ADD 7/scripts/alpine-setup.sh /tmp/setup.sh
ADD scripts/apache-entrypoint.sh /usr/local/bin/entrypoint.sh
ADD https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar /usr/local/bin/composer
# Create directory, and install required php app # Create directory, and install required php app
RUN /bin/mkdir -p /app ; \ RUN /bin/sh /tmp/setup.sh; \
/sbin/apk add --update --no-cache \ /bin/rm -f /tmp/*.sh; \
php${PHP_VER_SHORT} php${PHP_VER_SHORT}-common \
php${PHP_VER_SHORT}-cli php${PHP_VER_SHORT}-phar \
php${PHP_VER_SHORT}-iconv php${PHP_VER_SHORT}-mbstring ; \
/bin/chmod +rx /tmp/setup.sh /usr/local/bin/entrypoint.sh /usr/local/bin/composer; \
/bin/sh /tmp/setup.sh; \
/bin/rm -f /tmp/*.sh;
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
# CLEAN APK CACHES
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 ; \
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/* rm -vrf /var/cache/apk/*
FROM scratch FROM scratch
ARG PHP_VERSION=5.6 ARG PHP_VERSION=7.4
ARG PHP_VER_SHORT=5 ARG PHP_VER_SHORT=7
ENV PHP_VERSION=${PHP_VERSION} ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT} ENV PHP_VER_SHORT=${PHP_VER_SHORT}

View File

@ -6,14 +6,10 @@ ARG OS_VERSION=3.15
FROM quay.io/sindigilive/alpine:${OS_VERSION} FROM quay.io/sindigilive/alpine:${OS_VERSION}
LABEL maintainer="<Muhamad Aditya Prima> map@sindigilive.com" LABEL maintainer="<Muhamad Aditya Prima> map@sindigilive.com"
ARG WITH_APACHE=false
ARG WITH_DATABASE=false
ARG PHP_VERSION=7.4 ARG PHP_VERSION=7.4
ARG PHP_VER_SHORT=7 ARG PHP_VER_SHORT=7
ARG COMPOSER_VERSION=2.8.4 ARG COMPOSER_VERSION=2.8.4
ENV WITH_APACHE=${WITH_APACHE}
ENV WITH_DATABASE=${WITH_DATABASE}
ENV PHP_VERSION=${PHP_VERSION} ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT} ENV PHP_VER_SHORT=${PHP_VER_SHORT}
ENV COMPOSER_VERSION=${COMPOSER_VERSION} ENV COMPOSER_VERSION=${COMPOSER_VERSION}