Merge branch 'php5'

This commit is contained in:
Muhamad Aditya Prima 2024-12-16 23:24:23 +07:00
commit 94e33ef827
3 changed files with 215 additions and 0 deletions

View File

@ -0,0 +1,111 @@
name: Build and push PHP 5 container images
on:
push:
branches:
- php5
jobs:
build:
name: Build PHP 5 container images
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
strategy:
matrix:
flavors:
- os: "almalinux"
os_version: "8.10"
php_version: "5.6"
php_ver_short: "56"
mode: cli
with_server: "false"
with_database: "false"
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Login to quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ vars.QUAY_USERNAME }}
password: ${{ secrets.QUAY_SECRET }}
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- if: ${{ matrix.flavors.with_server == 'false' && matrix.flavors.with_database == 'false' }}
name: Build and push php5
uses: docker/build-push-action@v5
with:
push: true
context: .
file: 5/Dockerfile.${{ matrix.flavors.mode }}-${{ matrix.flavors.os }}
build-args: |
OS_VERSION=${{ matrix.flavors.os_version }}
FLAVOR=${{ matrix.flavors.mode }}
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.mode }}-${{ matrix.flavors.os }}
- if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database == 'false' }}
name: Build and push php5 with webserver
uses: docker/build-push-action@v5
with:
push: true
context: .
file: 5/Dockerfile.${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }}
build-args: |
OS_VERSION=${{ matrix.flavors.os_version }}
FLAVOR=${{ matrix.flavors.mode }}
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.mode }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }}
- if: ${{ matrix.flavors.with_server != 'false' && matrix.flavors.with_database != 'false' }}
name: Build and push php5 with apache2 and database connector library
uses: docker/build-push-action@v5
with:
push: true
context: .
file: 5/Dockerfile.${{ matrix.flavors.with_server }}-${{ matrix.flavors.os }}
build-args: |
OS_VERSION=${{ matrix.flavors.os_version }}
FLAVOR=${{ matrix.flavors.mode }}
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.mode }}-${{ matrix.flavors.with_server }}-${{ matrix.flavors.with_database }}-${{ matrix.flavors.os }}
# build-latest:
# name: Build latest nginx alpine based container images
# runs-on: ubuntu-latest
# needs:
# - build
# container:
# image: ghcr.io/catthehacker/ubuntu:act-latest
# steps:
# - name: Check out repository code
# uses: actions/checkout@v4
# - name: Login to quay.io
# uses: docker/login-action@v3
# with:
# registry: quay.io
# username: ${{ vars.QUAY_USERNAME }}
# password: ${{ secrets.QUAY_SECRET }}
# # - name: Set up QEMU
# # uses: docker/setup-qemu-action@v3
# - name: Setup Docker buildx
# uses: docker/setup-buildx-action@v3
# - name: Build and push latest nginx
# uses: docker/build-push-action@v5
# with:
# # platforms: linux/amd64,linux/arm64
# push: true
# context: .
# file: Dockerfile.alpine
# tags: |
# quay.io/sindigilive/nginx:alpine
# quay.io/sindigilive/nginx:latest

104
5/Dockerfile.cli-almalinux Normal file
View File

@ -0,0 +1,104 @@
ARG OS_VERSION=8.10
FROM quay.io/sindigilive/almalinux:${OS_VERSION} AS builder
ARG FLAVOR=cli
ARG WITH_APACHE=false
ARG PHP_VERSION=5.6
ARG PHP_VER_SHORT=56
ENV FLAVOR=${FLAVOR}
ENV WITH_APACHE=${WITH_APACHE}
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
WORKDIR /tmp
RUN mkdir -p /mnt/rootfs; \
dnf -y update; \
dnf install http://rpms.remirepo.net/enterprise/remi-release-8.rpm \
--releasever 8 --setopt install_weak_deps=false --nodocs -y; \
dnf module reset php; \
dnf install --installroot /mnt/rootfs \
coreutils-single \
glibc-minimal-langpack \
php${PHP_VER_SHORT}-php-cli \
php${PHP_VER_SHORT}-php-common \
--releasever 8 --setopt install_weak_deps=false --nodocs -y; \
dnf --installroot /mnt/rootfs clean all;
FROM quay.io/sindigilive/almalinux:${OS_VERSION}-micro AS stage2
ARG PHP_VER_SHORT=56
RUN mkdir -p /app;
COPY --from=builder \
/mnt/rootfs/usr/lib64/libcrypt.so.1 \
/mnt/rootfs/usr/lib64/libedit.so.0 \
/mnt/rootfs/usr/lib64/libstdc++.so.6 \
/mnt/rootfs/usr/lib64/libz.so.1 \
/mnt/rootfs/usr/lib64/libpcre.so.1 \
/mnt/rootfs/usr/lib64/libxml2.so.2 \
/mnt/rootfs/usr/lib64/liblzma.so.5 \
/mnt/rootfs/usr/lib64/libgssapi_krb5.so.2 \
/mnt/rootfs/usr/lib64/libkrb5.so.3 \
/mnt/rootfs/usr/lib64/libk5crypto.so.3 \
/mnt/rootfs/usr/lib64/libcom_err.so.2 \
/mnt/rootfs/usr/lib64/libssl.so.1.1 \
/mnt/rootfs/usr/lib64/libcrypto.so.1.1 \
/mnt/rootfs/usr/lib64/libkrb5support.so.0 \
/mnt/rootfs/usr/lib64/libkeyutils.so.1 \
/mnt/rootfs/usr/lib64/libbz2.so.1 \
/mnt/rootfs/usr/lib64/libcurl.so.4 \
/mnt/rootfs/usr/lib64/libbz2.so.1 \
/mnt/rootfs/usr/lib64/libnghttp2.so.14 \
/mnt/rootfs/usr/lib64/libzstd.so.1 \
/mnt/rootfs/usr/lib64/libidn2.so.0 \
/mnt/rootfs/usr/lib64/libssh.so.4 \
/mnt/rootfs/usr/lib64/libpsl.so.5 \
/mnt/rootfs/usr/lib64/libldap-2.4.so.2 \
/mnt/rootfs/usr/lib64/liblber-2.4.so.2 \
/mnt/rootfs/usr/lib64/libbrotlidec.so.1 \
/mnt/rootfs/usr/lib64/libunistring.so.2 \
/mnt/rootfs/usr/lib64/libsasl2.so.3 \
/mnt/rootfs/usr/lib64/libbrotlicommon.so.1 \
/usr/lib64
COPY --from=builder /mnt/rootfs/usr/share/Modules/modulefiles/php56 /usr/share/Modules/modulefiles/php56
COPY --from=builder /mnt/rootfs/opt/remi /opt/remi
COPY --from=builder /mnt/rootfs/var/opt/remi /var/opt/remi
COPY --from=builder /mnt/rootfs/etc/opt/remi /etc/opt/remi
COPY --from=builder /mnt/rootfs/etc/scl/prefixes/php56 /etc/scl/prefixes/php56
FROM scratch
ARG OS_VERSION=8.10
LABEL maintainer="Muhamad Aditya Prima <aprimediet@gmail.com>"
LABEL name="almalinux-micro"
LABEL version="${OS_VERSION}"
LABEL distribution-scope="public"
#labels for container catalog
LABEL summary="Almalinux 9 micro container image"
LABEL description="Provide latest release of micro Almalinux 9 container base image"
LABEL io.k8s.description="Very small almalinux 9 based image which doesn't install package manager"
LABEL io.k8s.display-name="Almalinux 9 Micro"
ARG PHP_VERSION=5.6
ARG PHP_VER_SHORT=56
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
COPY --from=stage2 / /
RUN ln -s /opt/remi/php${PHP_VER_SHORT}/root/usr/bin/php /usr/bin/php ; \
ln -s /opt/remi/php${PHP_VER_SHORT}/root/usr/bin/php-cgi /usr/bin/php-cgi ; \
ln -s /opt/remi/php${PHP_VER_SHORT}/root/usr/bin/php-phar /usr/bin/php-phar ; \
ln -s /opt/remi/php${PHP_VER_SHORT}/root/usr/bin/phpize /usr/bin/phpize ;
STOPSIGNAL SIGQUIT
CMD ["/usr/bin/php", "-v"]