added image with apache and build all flavor
Build and push PHP 8 container images / Build PHP 8 builder container images (map[os:alpine os_version:3.16 php_ver_short:8 php_version:8.0]) (push) Successful in 50s Details
Build and push PHP 8 container images / Build PHP 8 builder container images (map[os:alpine os_version:3.19 php_ver_short:81 php_version:8.1]) (push) Successful in 48s Details
Build and push PHP 8 container images / Build PHP 8 builder container images (map[os:alpine os_version:3.21 php_ver_short:83 php_version:8.2]) (push) Successful in 59s Details
Build and push PHP 8 container images / Build PHP 8 builder container images (map[os:alpine os_version:3.21 php_ver_short:83 php_version:8.3]) (push) Successful in 41s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.16 php_ver_short:8 php_version:8.0 with_database:false with_server:apache]) (push) Successful in 1m6s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.16 php_ver_short:8 php_version:8.0 with_database:false with_server:false]) (push) Successful in 49s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.16 php_ver_short:8 php_version:8.0 with_database:mysql with_server:apache]) (push) Successful in 1m4s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.16 php_ver_short:8 php_version:8.0 with_database:postgresql with_server:apache]) (push) Successful in 56s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.19 php_ver_short:81 php_version:8.1 with_database:false with_server:apache]) (push) Successful in 1m3s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.19 php_ver_short:81 php_version:8.1 with_database:false with_server:false]) (push) Successful in 1m4s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.19 php_ver_short:81 php_version:8.1 with_database:mysql with_server:apache]) (push) Successful in 55s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.19 php_ver_short:81 php_version:8.1 with_database:postgresql with_server:apache]) (push) Successful in 54s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.21 php_ver_short:82 php_version:8.2 with_database:false with_server:apache]) (push) Successful in 1m1s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.21 php_ver_short:82 php_version:8.2 with_database:false with_server:false]) (push) Successful in 46s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.21 php_ver_short:82 php_version:8.2 with_database:mysql with_server:apache]) (push) Successful in 57s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.21 php_ver_short:82 php_version:8.2 with_database:postgresql with_server:apache]) (push) Successful in 55s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.21 php_ver_short:83 php_version:8.3 with_database:false with_server:apache]) (push) Successful in 1m2s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.21 php_ver_short:83 php_version:8.3 with_database:false with_server:false]) (push) Successful in 57s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.21 php_ver_short:83 php_version:8.3 with_database:mysql with_server:apache]) (push) Successful in 54s Details
Build and push PHP 8 container images / Build PHP 8 container images (map[os:alpine os_version:3.21 php_ver_short:83 php_version:8.3 with_database:postgresql with_server:apache]) (push) Successful in 51s Details

This commit is contained in:
Muhamad Aditya Prima 2024-12-27 19:17:23 +07:00
parent 7728b1a728
commit 1376b21230
2 changed files with 224 additions and 137 deletions

View File

@ -55,144 +55,169 @@ 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:
# name: Build PHP 8 container images
# runs-on: ubuntu-latest
# needs:
# - builder
# container:
# image: ghcr.io/catthehacker/ubuntu:act-latest
# strategy:
# matrix:
# flavors:
# - os: "alpine"
# os_version: "3.9"
# php_version: "8.2"
# php_ver_short: "8"
# with_server: "false"
# with_database: "false"
# - os: "alpine"
# os_version: "3.12"
# php_version: "8.3"
# php_ver_short: "8"
# with_server: "false"
# with_database: "false"
# - os: "alpine"
# os_version: "3.15"
# php_version: "8.4"
# php_ver_short: "8"
# with_server: "false"
# with_database: "false"
# - os: "alpine" flavors:
# os_version: "3.9" name: Build PHP 8 container images
# php_version: "8.2" runs-on: ubuntu-latest
# php_ver_short: "8" needs:
# with_server: "apache" - builder
# with_database: "false" container:
# - os: "alpine" image: ghcr.io/catthehacker/ubuntu:act-latest
# os_version: "3.12" strategy:
# php_version: "8.3" matrix:
# php_ver_short: "8" flavors:
# with_server: "apache" - os: "alpine"
# with_database: "false" os_version: "3.16"
# - os: "alpine" php_version: "8.0"
# os_version: "3.15" php_ver_short: "8"
# php_version: "8.4" with_server: "false"
# php_ver_short: "8" with_database: "false"
# with_server: "apache" - os: "alpine"
# with_database: "false" os_version: "3.19"
php_version: "8.1"
php_ver_short: "81"
with_server: "false"
with_database: "false"
- os: "alpine"
os_version: "3.21"
php_version: "8.2"
php_ver_short: "82"
with_server: "false"
with_database: "false"
- os: "alpine"
os_version: "3.21"
php_version: "8.3"
php_ver_short: "83"
with_server: "false"
with_database: "false"
# - os: "alpine" - os: "alpine"
# os_version: "3.9" os_version: "3.16"
# php_version: "8.2" php_version: "8.0"
# php_ver_short: "8" php_ver_short: "8"
# with_server: "apache" with_server: "apache"
# with_database: "mysql" with_database: "false"
# - os: "alpine" - os: "alpine"
# os_version: "3.12" os_version: "3.19"
# php_version: "8.3" php_version: "8.1"
# php_ver_short: "8" php_ver_short: "81"
# with_server: "apache" with_server: "apache"
# with_database: "mysql" with_database: "false"
# - os: "alpine" - os: "alpine"
# os_version: "3.15" os_version: "3.21"
# php_version: "8.4" php_version: "8.2"
# php_ver_short: "8" php_ver_short: "82"
# with_server: "apache" with_server: "apache"
# with_database: "mysql" with_database: "false"
- os: "alpine"
os_version: "3.21"
php_version: "8.3"
php_ver_short: "83"
with_server: "apache"
with_database: "false"
# - os: "alpine" - os: "alpine"
# os_version: "3.9" os_version: "3.16"
# php_version: "8.2" php_version: "8.0"
# php_ver_short: "8" php_ver_short: "8"
# with_server: "apache" with_server: "apache"
# with_database: "postgresql" with_database: "mysql"
# - os: "alpine" - os: "alpine"
# os_version: "3.12" os_version: "3.19"
# php_version: "8.3" php_version: "8.1"
# php_ver_short: "8" php_ver_short: "81"
# with_server: "apache" with_server: "apache"
# with_database: "postgresql" with_database: "mysql"
# - os: "alpine" - os: "alpine"
# os_version: "3.15" os_version: "3.21"
# php_version: "8.4" php_version: "8.2"
# php_ver_short: "8" php_ver_short: "82"
# with_server: "apache" with_server: "apache"
# with_database: "postgresql" with_database: "mysql"
- os: "alpine"
os_version: "3.21"
php_version: "8.3"
php_ver_short: "83"
with_server: "apache"
with_database: "mysql"
# steps: - os: "alpine"
# - name: Check out repository code os_version: "3.16"
# uses: actions/checkout@v4 php_version: "8.0"
# - name: Login to quay.io php_ver_short: "8"
# uses: docker/login-action@v3 with_server: "apache"
# with: with_database: "postgresql"
# registry: quay.io - os: "alpine"
# username: ${{ vars.QUAY_USERNAME }} os_version: "3.19"
# password: ${{ secrets.QUAY_SECRET }} php_version: "8.1"
# # - name: Set up QEMU php_ver_short: "81"
# # uses: docker/setup-qemu-action@v3 with_server: "apache"
# - name: Setup Docker buildx with_database: "postgresql"
# uses: docker/setup-buildx-action@v3 - os: "alpine"
# - if: ${{ matrix.flavors.with_server == 'false' && matrix.flavors.with_database == 'false' }} os_version: "3.21"
# name: Build and push php8 php_version: "8.2"
# uses: docker/build-push-action@v5 php_ver_short: "82"
# with: with_server: "apache"
# push: true with_database: "postgresql"
# context: . - os: "alpine"
# file: 8/Dockerfile.${{ matrix.flavors.os }} os_version: "3.21"
# build-args: | php_version: "8.3"
# OS_VERSION=${{ matrix.flavors.os_version }} php_ver_short: "83"
# PHP_VERSION=${{ matrix.flavors.php_version }} with_server: "apache"
# PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} with_database: "postgresql"
# tags: |
# quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.os }} steps:
# - if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database == 'false' }} - name: Check out repository code
# name: Build and push php8 with webserver uses: actions/checkout@v4
# uses: docker/build-push-action@v5 - name: Login to quay.io
# with: uses: docker/login-action@v3
# push: true with:
# context: . registry: quay.io
# file: 8/Dockerfile.${{ matrix.flavors.os }}-${{ matrix.flavors.with_server }} username: ${{ vars.QUAY_USERNAME }}
# build-args: | password: ${{ secrets.QUAY_SECRET }}
# OS_VERSION=${{ matrix.flavors.os_version }} # - name: Set up QEMU
# PHP_VERSION=${{ matrix.flavors.php_version }} # uses: docker/setup-qemu-action@v3
# PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} - name: Setup Docker buildx
# WITH_APACHE=true uses: docker/setup-buildx-action@v3
# tags: | - if: ${{ matrix.flavors.with_server == 'false' && matrix.flavors.with_database == 'false' }}
# quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }} name: Build and push php8
# - if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database != 'false' }} uses: docker/build-push-action@v5
# name: Build and push php8 with webserver and database connector library with:
# uses: docker/build-push-action@v5 push: true
# with: context: .
# push: true file: 8/Dockerfile.${{ matrix.flavors.os }}
# context: . build-args: |
# file: 8/Dockerfile.${{ matrix.flavors.os }}-${{ matrix.flavors.with_server }} OS_VERSION=${{ matrix.flavors.os_version }}
# build-args: | PHP_VERSION=${{ matrix.flavors.php_version }}
# OS_VERSION=${{ matrix.flavors.os_version }} PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }}
# PHP_VERSION=${{ matrix.flavors.php_version }} tags: |
# PHP_VER_SHORT=${{ matrix.flavors.php_ver_short }} quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.os }}
# WITH_APACHE=true - if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database == 'false' }}
# WITH_DATABASE=${{ matrix.flavors.with_database }} name: Build and push php8 with webserver
# tags: | uses: docker/build-push-action@v5
# quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.with_database }}-${{ matrix.flavors.os }} with:
push: true
context: .
file: 8/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 php8 with webserver and database connector library
uses: docker/build-push-action@v5
with:
push: true
context: .
file: 8/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

@ -0,0 +1,62 @@
# PHP 8.0 == 3.16
# PHP 8.1 == 3.19
# PHP 8.2 == 3.21
# PHP 8.3 == 3.21
ARG OS_VERSION=3.21
ARG PHP_VERSION=8.3
FROM quay.io/sindigilive/php:${PHP_VERSION}-builder-alpine AS builder
USER root
ARG WITH_APACHE=true
ARG WITH_DATABASE=false
ENV WITH_APACHE=${WITH_APACHE}
ENV WITH_DATABASE=${WITH_DATABASE}
ENV APP_ROOT=${SERVER_ROOT}/htdocs
ADD scripts/apache-entrypoint.sh /usr/local/bin/entrypoint
ADD htdocs ${APP_ROOT}
# Create directory, and install required php app
RUN /bin/sh /tmp/setup.sh; \
/bin/rm -f /tmp/*.sh; \
rm -vrf /var/cache/apk/*; \
chmod +rx /usr/local/bin/entrypoint ; \
sed -i "s|#version#|${PHP_VERSION}|" /app/htdocs/index.html ; \
sed -i "s|#os#|alpine|" /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/*
FROM scratch
ARG PHP_VERSION=8.3
ARG PHP_VER_SHORT=83
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
LABEL maintainer="Muhamad Aditya Prima <map@sindigilive.com>"
LABEL name="php"
LABEL version="${PHP_VERSION}"
LABEL distribution-scope="public"
#labels for container catalog
LABEL summary="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="PHP ${PHP_VERSION}"
COPY --from=builder / /
USER apache
WORKDIR /app/htdocs
STOPSIGNAL SIGQUIT
CMD ["/usr/local/bin/entrypoint"]