Compare commits
2 Commits
a5c22a4332
...
b06b9eee11
Author | SHA1 | Date |
---|---|---|
|
b06b9eee11 | |
|
1c75b7ac19 |
|
@ -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
|
|
@ -0,0 +1,80 @@
|
|||
name: Build and push PHP 5 container images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- php5-composer
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build PHP 5 container images
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/catthehacker/ubuntu:act-latest
|
||||
strategy:
|
||||
matrix:
|
||||
flavors:
|
||||
- os: "alpine"
|
||||
os_version: "3.6"
|
||||
php_version: "5.6"
|
||||
php_ver_short: "5"
|
||||
composer_version: "2.2.25"
|
||||
composer_ver_short: "2.2"
|
||||
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 php5 with composer
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
file: 5/Dockerfile.composer-${{ 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 }}
|
||||
COMPOSER_VERSION=${{ matrix.flavors.composer_version }}
|
||||
COMPOSER_VER_SHORT=${{ matrix.flavors.composer_ver_short }}
|
||||
tags: |
|
||||
quay.io/sindigilive/php:${{ matrix.flavors.php_version }}-composer${{ matrix.flavors.composer_ver_short }}-${{ 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
|
|
@ -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"]
|
|
@ -7,18 +7,27 @@ LABEL maintainer="<Muhamad Aditya Prima> map@sindigilive.com"
|
|||
ARG PHP_VERSION=5.6
|
||||
ARG PHP_VER_SHORT=5
|
||||
ARG COMPOSER_VERSION=2.2.25
|
||||
ARG COMPOSER_VER_SHORT=2.2
|
||||
|
||||
ENV PHP_VERSION=${PHP_VERSION}
|
||||
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
|
||||
ENV COMPOSER_VERSION=${COMPOSER_VERSION}
|
||||
ENV COMPOSER_VER_SHORT=${COMPOSER_VER_SHORT}
|
||||
|
||||
# Set composer home
|
||||
ENV COMPOSER_HOME=/app
|
||||
ENV COMPOSER_CACHE_DIR=${COMPOSER_HOME}/cache
|
||||
|
||||
WORKDIR /root
|
||||
ENV FLAVOR="full"
|
||||
ENV WITH_DATABASE="false"
|
||||
ENV WITH_SERVER="false"
|
||||
|
||||
ADD 5/scripts/alpine-composer-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 ${COMPOSER_HOME}/build ${COMPOSER_CACHE_DIR}/files \
|
||||
|
@ -28,10 +37,10 @@ RUN /bin/mkdir -p ${COMPOSER_HOME}/build ${COMPOSER_CACHE_DIR}/files \
|
|||
/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;
|
||||
/bin/chown -R composer:composer ${COMPOSER_HOME} ; \
|
||||
/bin/chmod 755 ./setup.sh /usr/local/bin/composer ; \
|
||||
/bin/sh ./setup.sh; \
|
||||
/bin/rm -f ./*;
|
||||
|
||||
# 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
|
||||
|
@ -44,10 +53,12 @@ FROM scratch
|
|||
ARG PHP_VERSION=5.6
|
||||
ARG PHP_VER_SHORT=5
|
||||
ARG COMPOSER_VERSION=2.2.25
|
||||
ARG COMPOSER_VER_SHORT=2.2
|
||||
|
||||
ENV PHP_VERSION=${PHP_VERSION}
|
||||
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
|
||||
ENV COMPOSER_VERSION=${COMPOSER_VERSION}
|
||||
ENV COMPOSER_VER_SHORT=${COMPOSER_VER_SHORT}
|
||||
|
||||
# Set composer home
|
||||
ENV COMPOSER_HOME=/app
|
||||
|
@ -72,4 +83,4 @@ WORKDIR ${COMPOSER_HOME}/build
|
|||
|
||||
STOPSIGNAL SIGQUIT
|
||||
|
||||
CMD ["/usr/bin/composer", "-V"]
|
||||
CMD ["/usr/local/bin/composer", "-V"]
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
#!/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;
|
|
@ -4,12 +4,12 @@ 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,
|
||||
intl,json,ldap,mcrypt,
|
||||
opcache,openssl,pcntl,pdo,
|
||||
pear,phar,phpdbg,
|
||||
posix,pspell,shmop,
|
||||
snmp,soap,sockets,sysvmsg,sysvsem,
|
||||
sysvshm,wddx,xcache,xml,xmlreader,
|
||||
sysvshm,wddx,xml,xmlreader,
|
||||
xmlrpc,xsl,zip,zlib"
|
||||
PHP_DEPS=""
|
||||
# apache2 configurations
|
||||
|
@ -57,10 +57,10 @@ if [ "$WITH_APACHE" == "true" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if ["$WITH_DATABASE" == "postgresql"]; then
|
||||
if [ "$WITH_DATABASE" == "postgresql" ]; then
|
||||
/sbin/apk add --update --no-cache php$PHP_VER_SHORT-pdo php$PHP_VER_SHORT-pdo_pgsql php$PHP_VER_SHORT-pgsql ;
|
||||
fi
|
||||
|
||||
if ["$WITH_DATABASE" == "mysql"]; then
|
||||
if [ "$WITH_DATABASE" == "mysql" ]; then
|
||||
/sbin/apk add --update --no-cache php$PHP_VER_SHORT-pdo php$PHP_VER_SHORT-pdo_mysql php$PHP_VER_SHORT-mysql php$PHP_VER_SHORT-mysqli ;
|
||||
fi
|
Loading…
Reference in New Issue