diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e1f1b5..f075756 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,10 +11,134 @@ on: - '**' - '!README.md' jobs: + php84_alpine: + env: + DISTRO: "alpine" + DISTRO_VARIANT: "3.21" + PHP_BASE: 8.4 + build_file: Dockerfile + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ vars.LATEST }}" = "TRUE" ] || [ "${{ vars.LATEST }}" = "${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${{ vars.LATEST_ALPINE }}" = "${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v6 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md + php83_alpine: env: DISTRO: "alpine" - DISTRO_VARIANT: "3.20" + DISTRO_VARIANT: "3.21" PHP_BASE: 8.3 build_file: Dockerfile runs-on: ubuntu-latest @@ -261,7 +385,7 @@ jobs: php82_alpine: env: DISTRO: "alpine" - DISTRO_VARIANT: "3.20" + DISTRO_VARIANT: "3.21" PHP_BASE: 8.2 build_file: Dockerfile runs-on: ubuntu-latest @@ -1378,6 +1502,130 @@ jobs: short-description: ${{ github.event.repository.description }} readme-filepath: ./README.md ### + php84_debian_bookworm: + env: + DISTRO: "debian" + DISTRO_VARIANT: "bookworm" + PHP_BASE: 8.4 + build_file: Dockerfile.debian + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + id: prep + run: | + if [[ "${GITHUB_REF}" == refs/heads/* ]]; then + if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then + git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" + else + git_branch=${GITHUB_REF#refs/heads/} + fi + + case "${git_branch}" in + "main" | "master" ) + if [ "${{ vars.LATEST }}" = "TRUE" ] || [ "${{ vars.LATEST }}" = "${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}" ]; then + image_latest=",${GITHUB_REPOSITORY}:latest" + fi + if [ "${{ vars.LATEST_ALPINE }}" = "${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}" ]; then + image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" + fi + branch_tag="${GITHUB_REPOSITORY}:${PHP_BASE},${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}${image_latest}" + ;; + "develop" ) + branch_tag="${GITHUB_REPOSITORY}:develop" + ;; + esac + fi + + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + git_tag="${GITHUB_REPOSITORY}:${PHP_BASE}-${DISTRO}-${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" + fi + + if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then + image_tags=${branch_tag},${git_tag} + else + image_tags="${branch_tag}${git_tag}" + fi + + echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV + dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") + ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") + echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT + - name: Label + id: Label + run: | + image_name=${GITHUB_REPOSITORY/docker-/} + if [ -f "${{ env.build_file }}" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} + sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} + + if [ -f "CHANGELOG.md" ] ; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} + mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md + fi + + if [[ $GITHUB_REF == refs/tags/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} + fi + + if [[ $GITHUB_REF == refs/heads/* ]]; then + sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} + fi + fi + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm,arm64 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v6 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./${{ env.build_file }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: ${{ steps.prep.outputs.container_images }} + build-args: | + DISTRO=${{ env.DISTRO }} + DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} + PHP_BASE=${{ env.PHP_BASE }} + + - name: Update Docker Hub Information + if: github.event_name != 'pull_request' + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.dockerhub_repo }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./README.md +# php83_debian_bookworm: env: DISTRO: "debian" diff --git a/CHANGELOG.md b/CHANGELOG.md index 78ed7ea..ea0b947 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 7.7.14 2024-12-07 + + ### Added + - Add PHP 8.4 Support + + ### Changed + - Switch PHP 8.3 and PHP 8.2 to use Alpine 3.21 as base + + ## 7.7.13 2024-10-22 ### Added diff --git a/Dockerfile b/Dockerfile index 356b589..14518ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ ARG DISTRO=alpine -ARG DISTRO_VARIANT=3.20 +ARG DISTRO_VARIANT=3.21 -FROM docker.io/tiredofit/nginx:${DISTRO}-${DISTRO_VARIANT}-6.5.4 +FROM docker.io/tiredofit/nginx:${DISTRO}-${DISTRO_VARIANT}-6.5.7 LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" ARG PHP_BASE -ENV PHP_BASE=${PHP_BASE:-"8.3"} \ +ENV PHP_BASE=${PHP_BASE:-"8.4"} \ PHP_ENABLE_APCU=TRUE \ PHP_ENABLE_BCMATH=TRUE \ PHP_ENABLE_BZ2=TRUE \ @@ -42,11 +42,106 @@ ENV PHP_BASE=${PHP_BASE:-"8.3"} \ ### Dependency Installation RUN case "${PHP_BASE}" in \ + 8.4 ) export php_folder="84" export build_gnupg=true ;; \ 8.3 ) export php_folder="83" export build_gnupg=true ;; \ 8.2 ) export php_folder="82" export build_gnupg=true ;; \ 8.1 ) export php_folder="81" export build_gnupg=true ;; \ *) export php_folder=${PHP_BASE:0:1} ; export build_gnupg=false ;; \ esac ; \ + export PHP_8_4_RUN_DEPS=" \ + gnu-libiconv \ + mariadb-connector-c \ + php84 \ + php84-bcmath \ + php84-bz2 \ + php84-calendar \ + php84-common \ + php84-ctype \ + php84-curl \ + php84-dba \ + php84-dom \ + php84-embed \ + php84-enchant \ + php84-exif \ + php84-ffi \ + php84-fileinfo \ + php84-fpm \ + php84-ftp \ + php84-gd \ + php84-gettext \ + php84-gmp \ + php84-iconv \ + php84-imap \ + php84-intl \ + php84-ldap \ + php84-litespeed \ + php84-mbstring \ + php84-mysqli \ + php84-mysqlnd \ + php84-odbc \ + php84-opcache \ + php84-openssl \ + php84-pcntl \ + php84-pdo \ + php84-pdo_dblib \ + php84-pdo_mysql \ + php84-pdo_odbc \ + php84-pdo_pgsql \ + php84-pdo_sqlite \ + php84-pear \ + php84-pecl-amqp \ + php84-pecl-apcu \ + php84-pecl-ast \ + php84-pecl-brotli \ + php84-pecl-couchbase \ + php84-pecl-ds \ + php84-pecl-event \ + php84-pecl-grpc \ + php84-pecl-imagick \ + php84-pecl-igbinary \ + php84-pecl-maxminddb \ + php84-pecl-memcache \ + php84-pecl-memcached \ + php84-pecl-mongodb \ + php84-pecl-msgpack \ + php84-pecl-opentelemetry \ + php84-pecl-pcov \ + php84-pecl-psr \ + php84-pecl-rdkafka \ + php84-pecl-redis \ + php84-pecl-smbclient \ + php84-pecl-ssh2 \ + php84-pecl-swoole \ + php84-pecl-uploadprogress \ + php84-pecl-xdebug \ + php84-pecl-xhprof \ + php84-pecl-xhprof-assets \ + php84-pecl-yaml \ + php84-pecl-zstd \ + php84-pgsql \ + php84-phar \ + php84-posix \ + php84-pspell \ + php84-session \ + php84-shmop \ + php84-simplexml \ + php84-snmp \ + php84-soap \ + php84-sockets \ + php84-sodium \ + php84-sqlite3 \ + php84-sysvmsg \ + php84-sysvsem \ + php84-sysvshm \ + php84-tidy \ + php84-tokenizer \ + php84-xml \ + php84-xmlreader \ + php84-xmlwriter \ + php84-xsl \ + php84-zip \ + " && \ + \ export PHP_8_3_RUN_DEPS=" \ gnu-libiconv \ mariadb-connector-c \ diff --git a/Dockerfile.debian b/Dockerfile.debian index a0fd07d..3c0bf73 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -6,7 +6,7 @@ LABEL maintainer="Dave Conroy (dave at tiredofit dot ca)" ARG PHP_BASE -ENV PHP_BASE=${PHP_BASE:-"8.2"} \ +ENV PHP_BASE=${PHP_BASE:-"8.4"} \ PHP_ENABLE_APCU=TRUE \ PHP_ENABLE_BCMATH=TRUE \ PHP_ENABLE_BZ2=TRUE \ @@ -73,6 +73,9 @@ RUN export PHP_7_3_RUN_DEPS=" \ export PHP_8_3_RUN_DEPS=" \ " && \ \ + export PHP_8_4_RUN_DEPS=" \ + " && \ + \ export PHP_ADDITIONAL_MODULES=" \ php$PHP_BASE-ast \ php$PHP_BASE-apcu \ diff --git a/README.md b/README.md index 31c21d7..7f11386 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,9 @@ The following image tags are available along with their tagged release based on | PHP version | Alpine Base | Tag | Debian Base | Tag | | ----------- | ----------- | -------------- | ----------- | ---------------------- | | latest | edge | `:alpine-edge` | | | -| 8.3.x | 3.20 | `:8.3-alpine` | Bookworm | `:8.3-debian-bookworm` | -| 8.2.x | 3.20 | `:8.2-alpine` | Bookworm | `:8.2-debian-bookworm` | +| 8.4.x | 3.21 | `:8.3-alpine` | Bookworm | `:8.4-debian-bookworm` | +| 8.3.x | 3.21 | `:8.3-alpine` | Bookworm | `:8.3-debian-bookworm` | +| 8.2.x | 3.21 | `:8.2-alpine` | Bookworm | `:8.2-debian-bookworm` | | 8.1.x | 3.19 | `:8.1-alpine` | Bookworm | `:8.1-debian-bookworm` | | 8.0.x | 3.16 | `:8.0-alpine` | Bookworm | `:8.0-debian-bookworm` | | 7.4.x | 3.15 | `:7.4-alpine` | Bookworm | `:7.4-debian-bookworm` |