From bee6677e974ade78ebcb80d27307dd605f47f4eb Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 13:31:30 +0100 Subject: [PATCH 01/15] Add PHP 8.3-8.5 images and migrate CI to GitHub Actions Add 8.3 (alpine:3.19), 8.4 (alpine:3.21), and 8.5 (alpine:3.22) images mirroring the 8.2 layout, switching libssl1.1 to libssl3 on the newer Alpine bases. Replace .travis.yml with .github/workflows/build.yml running a matrix build/test across all supported PHP versions and deploying to Docker Hub on master pushes. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build.yml | 56 ++++++++++++++++++++ .travis.yml | 35 ------------ 8.3/.dockerignore | 1 + 8.3/Dockerfile | 79 ++++++++++++++++++++++++++++ 8.3/debug.Dockerfile | 10 ++++ 8.3/php.bats | 64 ++++++++++++++++++++++ 8.3/php/conf.d/00_memlimit.ini | 3 ++ 8.3/php/conf.d/00_short_open_tag.ini | 13 +++++ 8.3/php_debug.bats | 9 ++++ 8.3/tags.bats | 13 +++++ 8.4/.dockerignore | 1 + 8.4/Dockerfile | 79 ++++++++++++++++++++++++++++ 8.4/debug.Dockerfile | 10 ++++ 8.4/php.bats | 64 ++++++++++++++++++++++ 8.4/php/conf.d/00_memlimit.ini | 3 ++ 8.4/php/conf.d/00_short_open_tag.ini | 13 +++++ 8.4/php_debug.bats | 9 ++++ 8.4/tags.bats | 13 +++++ 8.5/.dockerignore | 1 + 8.5/Dockerfile | 79 ++++++++++++++++++++++++++++ 8.5/debug.Dockerfile | 10 ++++ 8.5/php.bats | 64 ++++++++++++++++++++++ 8.5/php/conf.d/00_memlimit.ini | 3 ++ 8.5/php/conf.d/00_short_open_tag.ini | 13 +++++ 8.5/php_debug.bats | 9 ++++ 8.5/tags.bats | 13 +++++ Makefile | 18 +++---- README.md | 16 ++++-- 28 files changed, 654 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml create mode 100644 8.3/.dockerignore create mode 100644 8.3/Dockerfile create mode 100644 8.3/debug.Dockerfile create mode 100755 8.3/php.bats create mode 100644 8.3/php/conf.d/00_memlimit.ini create mode 100644 8.3/php/conf.d/00_short_open_tag.ini create mode 100755 8.3/php_debug.bats create mode 100644 8.3/tags.bats create mode 100644 8.4/.dockerignore create mode 100644 8.4/Dockerfile create mode 100644 8.4/debug.Dockerfile create mode 100755 8.4/php.bats create mode 100644 8.4/php/conf.d/00_memlimit.ini create mode 100644 8.4/php/conf.d/00_short_open_tag.ini create mode 100755 8.4/php_debug.bats create mode 100644 8.4/tags.bats create mode 100644 8.5/.dockerignore create mode 100644 8.5/Dockerfile create mode 100644 8.5/debug.Dockerfile create mode 100755 8.5/php.bats create mode 100644 8.5/php/conf.d/00_memlimit.ini create mode 100644 8.5/php/conf.d/00_short_open_tag.ini create mode 100755 8.5/php_debug.bats create mode 100644 8.5/tags.bats diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d8f5dbc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,56 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + name: PHP ${{ matrix.version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: + - "5.6" + - "7.0" + - "7.1" + - "7.2" + - "7.3" + - "7.4" + - "8.0" + - "8.1" + - "8.2" + - "8.3" + - "8.4" + - "8.5" + steps: + - uses: actions/checkout@v6 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Build + run: make build-${{ matrix.version }} + + - name: Tag + run: make tag-${{ matrix.version }} + + - name: Test + run: make test-${{ matrix.version }} + + - name: Login to Docker Hub + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Deploy + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + run: make deploy-${{ matrix.version }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5afd2cf..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -sudo: required - -language: generic - -services: - - docker - -env: - matrix: - - VER=5.6 - - VER=7.0 - - VER=7.1 - - VER=7.2 - - VER=7.3 - - VER=7.4 - - VER=8.0 - global: - # DOCKER_USERNAME - - secure: hJxx3pt08GGxbaSWKMYWXVvwlrn/sJbh4rpLveUGz5pd9C8IcvkOJsrXrtVqr7/4jb5/CQwz65cGyukxzbonvUZgt0mfmZ9GunpD1pz3IusjXvYlZOZ1LL/i6t57J7fMKtUXxBTWNQSS9pH7pEHixvMabS3kqQb74Nj6wQFNzucmnEQGCT0drs8NrlfEfaNdXkJ5ijqdY42QM0BfGU7SnO0/puaEapl3I/n1TLWf60YUV2etl8BaFZckX7ewHvLWs+nXtHUMSezO/9jupb2pOR600+/77Pdfj735hvymD/gAjzTMRJlcUAOThkQfwI4Zt4MoJKvjXbrcYYsz5yEk4o8wPRX/5lZUso2NNRR/J3ahTZZGpDxp+plwY+v6KYwC7L6Bc6HYZbDaxMMXvMokxjyyAtmewaWsVEf+VDTxg5wowJj6esfd+Z0a6IvBFiVxOzltRtR4SqLvFrjq5vPM+RHK1UStJOHCNjpDq5BrEo7bWp+Fi66LpWQYQEL15EjQy3xcx9pfY+5rHot0ClHSqror9RQmQSmmsQWZCFEcjwt07hbmwp75LjFeQm0wRAl6dBZ1CJly/6daVIv4cj7bh72McrhesXc2EmesxEbQaUd/rJjGhaoZ/joPR8gN2RLnCFPzCXdITHXWxThjUZZwPIqtJiI3xXR5vmWidV552ZA= - # DOCKER_PASSWORD - - secure: YfZCh36+apqqmIGrFx+VxhgUqNLNrAwp5BoYshJCHu0iZofVYPHxIsgauQ4vQZj/lYnqe0Ak7qG+s9vnt+OHb8rVyLaZXVRkKFFfbjuu3nOrdFgJwhFbWfjptWogoSM2X1wJtheO40oYAjegF7cq4Bxp14ux/telYCUm8mx7k/h1KoUJOzNzuZCyeh95bQPBAkzIKA1a9rupYMH/LOWLuoTCFmN0eU6VGjwK1XZoDq1uZpYk/YH8VAUvefSS2uE9/WLjoRSTJAk0A4tcVbzPN0FbDTGW59/MbqH6diZ8/KZjcALbmaNtGZGOixn0zgushSN9uSIJk9V/WKamTF08KCS79Ud1aIGYf5UtzBAycnPY2/Y7mA9Ktk/BTWui5OLk2XItY7Ts7N9ikFw+9i3e91YBxxGCVrnsLug+Ih1Ipjyu/8SN9Ttzqp2/6zBFf+sDFXTPnMpptSXTKMcXy/pJVVGIUe38L7BJdUKE1Xp4BqBVnJyaZL8UQVSKdh3kU6C/OfEud6HrIHfAKg6S71rOQBzOk+V+p/U5L4wQCJYLuyGFEuPdMP27wnLh3oUMhnkPK28EpuG0Z5RTH1Sd5MGaHThyDwEtJaECyIMndKY9Wx73gmvvwe2rrltkjHc44jyBG53B8iXNeG/kmKAqPewHHJbxC//A6ykFEnvO7tbF6To= - -script: - - make build-${VER} - - make tag-${VER} - - make test-${VER} - -deploy: - - provider: script - script: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && make deploy-${VER} - on: - branch: master - -matrix: - fast_finish: true diff --git a/8.3/.dockerignore b/8.3/.dockerignore new file mode 100644 index 0000000..e46b33e --- /dev/null +++ b/8.3/.dockerignore @@ -0,0 +1 @@ +*.bats diff --git a/8.3/Dockerfile b/8.3/Dockerfile new file mode 100644 index 0000000..2ba152b --- /dev/null +++ b/8.3/Dockerfile @@ -0,0 +1,79 @@ +FROM alpine:3.19 + +LABEL maintainer="developers@graze.com" \ + license="MIT" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.vendor="graze" \ + org.label-schema.name="php-alpine" \ + org.label-schema.description="small php image based on alpine" \ + org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" + +# Fix for iconv: https://github.com/docker-library/php/issues/240 +RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted + +RUN set -xe \ + && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.19/community" >> /etc/apk/repositories \ + && apk add --update --no-cache \ + ca-certificates \ + curl \ + gnu-libiconv \ + openssh-client \ + libmemcached-libs \ + libevent \ + libssl3 \ + musl \ + yaml \ + php83 \ + php83-pecl-apcu \ + php83-pecl-event \ + php83-pecl-memcached \ + php83-pecl-yaml \ + php83-bcmath \ + php83-common \ + php83-ctype \ + php83-curl \ + php83-dom \ + php83-fileinfo \ + php83-iconv \ + php83-intl \ + php83-openssl \ + php83-opcache \ + php83-mbstring \ + php83-mysqlnd \ + php83-mysqli \ + php83-pcntl \ + php83-pgsql \ + php83-pdo_mysql \ + php83-pdo_pgsql \ + php83-pdo_sqlite \ + php83-phar \ + php83-posix \ + php83-simplexml \ + php83-session \ + php83-soap \ + php83-sockets \ + php83-sodium \ + php83-tokenizer \ + php83-xml \ + php83-xmlreader \ + php83-xmlwriter \ + php83-zip \ + php83-zlib + +ENV PHP_INI_DIR /etc/php83 + +RUN ln -s /usr/bin/php83 /usr/bin/php +RUN ln -s /usr/bin/pecl83 /usr/bin/pecl + +COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/ + +WORKDIR /srv + +ARG BUILD_DATE +ARG VCS_REF + +LABEL org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.build-date=$BUILD_DATE + +# Fix for iconv: https://github.com/docker-library/php/issues/240 +ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/8.3/debug.Dockerfile b/8.3/debug.Dockerfile new file mode 100644 index 0000000..58d3d1f --- /dev/null +++ b/8.3/debug.Dockerfile @@ -0,0 +1,10 @@ +FROM graze/php-alpine:8.3 + +RUN apk add --update --no-cache \ + php83-phpdbg + +ARG BUILD_DATE +ARG VCS_REF + +LABEL org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.build-date=$BUILD_DATE diff --git a/8.3/php.bats b/8.3/php.bats new file mode 100755 index 0000000..90b541a --- /dev/null +++ b/8.3/php.bats @@ -0,0 +1,64 @@ +#!/usr/bin/env bats + +@test "php version is correct" { + run docker run --rm ${container} php -v + echo 'status:' $status + echo 'output:' $output + version="$(echo $output | sed 's/.*PHP \([0-9].[0-9]\).*/\1/')" + echo 'version:' $version + [ "$status" -eq 0 ] + [[ "$version" == "8.3" ]] +} + +@test "the image has the correct php modules installed" { + run docker run --rm ${container} php -m + echo 'status:' $status + echo 'output:' $output + [ "$status" -eq 0 ] + [[ "${output}" == *"apcu"* ]] + [[ "${output}" == *"bcmath"* ]] + [[ "${output}" == *"Core"* ]] + [[ "${output}" == *"ctype"* ]] + [[ "${output}" == *"curl"* ]] + [[ "${output}" == *"date"* ]] + [[ "${output}" == *"dom"* ]] + [[ "${output}" == *"event"* ]] + [[ "${output}" == *"fileinfo"* ]] + [[ "${output}" == *"filter"* ]] + [[ "${output}" == *"hash"* ]] + [[ "${output}" == *"iconv"* ]] + [[ "${output}" == *"intl"* ]] + [[ "${output}" == *"json"* ]] + [[ "${output}" == *"libxml"* ]] + [[ "${output}" == *"mbstring"* ]] + [[ "${output}" == *"memcached"* ]] + [[ "${output}" == *"mysqli"* ]] + [[ "${output}" == *"mysqlnd"* ]] + [[ "${output}" == *"openssl"* ]] + [[ "${output}" == *"pcre"* ]] + [[ "${output}" == *"pcntl"* ]] + [[ "${output}" == *"PDO"* ]] + [[ "${output}" == *"pdo_mysql"* ]] + [[ "${output}" == *"pdo_pgsql"* ]] + [[ "${output}" == *"pdo_sqlite"* ]] + [[ "${output}" == *"pgsql"* ]] + [[ "${output}" == *"Phar"* ]] + [[ "${output}" == *"posix"* ]] + [[ "${output}" == *"readline"* ]] + [[ "${output}" == *"Reflection"* ]] + [[ "${output}" == *"session"* ]] + [[ "${output}" == *"SimpleXML"* ]] + [[ "${output}" == *"soap"* ]] + [[ "${output}" == *"sodium"* ]] + [[ "${output}" == *"sockets"* ]] + [[ "${output}" == *"SPL"* ]] + [[ "${output}" == *"standard"* ]] + [[ "${output}" == *"tokenizer"* ]] + [[ "${output}" == *"xml"* ]] + [[ "${output}" == *"xmlreader"* ]] + [[ "${output}" == *"xmlwriter"* ]] + [[ "${output}" == *"yaml"* ]] + [[ "${output}" == *"Zend OPcache"* ]] + [[ "${output}" == *"zip"* ]] + [[ "${output}" == *"zlib"* ]] +} diff --git a/8.3/php/conf.d/00_memlimit.ini b/8.3/php/conf.d/00_memlimit.ini new file mode 100644 index 0000000..d0c56ed --- /dev/null +++ b/8.3/php/conf.d/00_memlimit.ini @@ -0,0 +1,3 @@ +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 1024M diff --git a/8.3/php/conf.d/00_short_open_tag.ini b/8.3/php/conf.d/00_short_open_tag.ini new file mode 100644 index 0000000..6f4646c --- /dev/null +++ b/8.3/php/conf.d/00_short_open_tag.ini @@ -0,0 +1,13 @@ +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It's been +; recommended for several years that you not use the short tag "short cut" and +; instead to use the full tag combination. With the wide spread use +; of XML and use of these tags by other languages, the server can become easily +; confused and end up parsing the wrong code in the wrong context. But because +; this short cut has been a feature for such a long time, it's currently still +; supported for backwards compatibility, but we recommend you don't use them. +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/short-open-tag +short_open_tag = On diff --git a/8.3/php_debug.bats b/8.3/php_debug.bats new file mode 100755 index 0000000..b226611 --- /dev/null +++ b/8.3/php_debug.bats @@ -0,0 +1,9 @@ +#!/usr/bin/env bats + +@test "the image has phpdbg" { + run docker run ${container} which phpdbg83 + echo 'status:' $status + echo 'output:' $output + [ "$status" -eq 0 ] + [[ "${output}" == *"phpdbg83"* ]] +} diff --git a/8.3/tags.bats b/8.3/tags.bats new file mode 100644 index 0000000..d8c9c09 --- /dev/null +++ b/8.3/tags.bats @@ -0,0 +1,13 @@ +#!/usr/bin/env bats + +@test "the main tags are created" { + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.3 --format '{{.ID}}')"" + echo 'output:' $output + [[ "$output" == *"(8.3)"* ]] +} + +@test "the test tags are created" { + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.3-test --format '{{.ID}}')"" + echo 'output:' $output + [[ "$output" == *"(8.3-test)"* ]] +} diff --git a/8.4/.dockerignore b/8.4/.dockerignore new file mode 100644 index 0000000..e46b33e --- /dev/null +++ b/8.4/.dockerignore @@ -0,0 +1 @@ +*.bats diff --git a/8.4/Dockerfile b/8.4/Dockerfile new file mode 100644 index 0000000..991e3b4 --- /dev/null +++ b/8.4/Dockerfile @@ -0,0 +1,79 @@ +FROM alpine:3.21 + +LABEL maintainer="developers@graze.com" \ + license="MIT" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.vendor="graze" \ + org.label-schema.name="php-alpine" \ + org.label-schema.description="small php image based on alpine" \ + org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" + +# Fix for iconv: https://github.com/docker-library/php/issues/240 +RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted + +RUN set -xe \ + && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.21/community" >> /etc/apk/repositories \ + && apk add --update --no-cache \ + ca-certificates \ + curl \ + gnu-libiconv \ + openssh-client \ + libmemcached-libs \ + libevent \ + libssl3 \ + musl \ + yaml \ + php84 \ + php84-pecl-apcu \ + php84-pecl-event \ + php84-pecl-memcached \ + php84-pecl-yaml \ + php84-bcmath \ + php84-common \ + php84-ctype \ + php84-curl \ + php84-dom \ + php84-fileinfo \ + php84-iconv \ + php84-intl \ + php84-openssl \ + php84-opcache \ + php84-mbstring \ + php84-mysqlnd \ + php84-mysqli \ + php84-pcntl \ + php84-pgsql \ + php84-pdo_mysql \ + php84-pdo_pgsql \ + php84-pdo_sqlite \ + php84-phar \ + php84-posix \ + php84-simplexml \ + php84-session \ + php84-soap \ + php84-sockets \ + php84-sodium \ + php84-tokenizer \ + php84-xml \ + php84-xmlreader \ + php84-xmlwriter \ + php84-zip \ + php84-zlib + +ENV PHP_INI_DIR /etc/php84 + +RUN ln -s /usr/bin/php84 /usr/bin/php +RUN ln -s /usr/bin/pecl84 /usr/bin/pecl + +COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/ + +WORKDIR /srv + +ARG BUILD_DATE +ARG VCS_REF + +LABEL org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.build-date=$BUILD_DATE + +# Fix for iconv: https://github.com/docker-library/php/issues/240 +ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/8.4/debug.Dockerfile b/8.4/debug.Dockerfile new file mode 100644 index 0000000..0f6f34c --- /dev/null +++ b/8.4/debug.Dockerfile @@ -0,0 +1,10 @@ +FROM graze/php-alpine:8.4 + +RUN apk add --update --no-cache \ + php84-phpdbg + +ARG BUILD_DATE +ARG VCS_REF + +LABEL org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.build-date=$BUILD_DATE diff --git a/8.4/php.bats b/8.4/php.bats new file mode 100755 index 0000000..e9db29e --- /dev/null +++ b/8.4/php.bats @@ -0,0 +1,64 @@ +#!/usr/bin/env bats + +@test "php version is correct" { + run docker run --rm ${container} php -v + echo 'status:' $status + echo 'output:' $output + version="$(echo $output | sed 's/.*PHP \([0-9].[0-9]\).*/\1/')" + echo 'version:' $version + [ "$status" -eq 0 ] + [[ "$version" == "8.4" ]] +} + +@test "the image has the correct php modules installed" { + run docker run --rm ${container} php -m + echo 'status:' $status + echo 'output:' $output + [ "$status" -eq 0 ] + [[ "${output}" == *"apcu"* ]] + [[ "${output}" == *"bcmath"* ]] + [[ "${output}" == *"Core"* ]] + [[ "${output}" == *"ctype"* ]] + [[ "${output}" == *"curl"* ]] + [[ "${output}" == *"date"* ]] + [[ "${output}" == *"dom"* ]] + [[ "${output}" == *"event"* ]] + [[ "${output}" == *"fileinfo"* ]] + [[ "${output}" == *"filter"* ]] + [[ "${output}" == *"hash"* ]] + [[ "${output}" == *"iconv"* ]] + [[ "${output}" == *"intl"* ]] + [[ "${output}" == *"json"* ]] + [[ "${output}" == *"libxml"* ]] + [[ "${output}" == *"mbstring"* ]] + [[ "${output}" == *"memcached"* ]] + [[ "${output}" == *"mysqli"* ]] + [[ "${output}" == *"mysqlnd"* ]] + [[ "${output}" == *"openssl"* ]] + [[ "${output}" == *"pcre"* ]] + [[ "${output}" == *"pcntl"* ]] + [[ "${output}" == *"PDO"* ]] + [[ "${output}" == *"pdo_mysql"* ]] + [[ "${output}" == *"pdo_pgsql"* ]] + [[ "${output}" == *"pdo_sqlite"* ]] + [[ "${output}" == *"pgsql"* ]] + [[ "${output}" == *"Phar"* ]] + [[ "${output}" == *"posix"* ]] + [[ "${output}" == *"readline"* ]] + [[ "${output}" == *"Reflection"* ]] + [[ "${output}" == *"session"* ]] + [[ "${output}" == *"SimpleXML"* ]] + [[ "${output}" == *"soap"* ]] + [[ "${output}" == *"sodium"* ]] + [[ "${output}" == *"sockets"* ]] + [[ "${output}" == *"SPL"* ]] + [[ "${output}" == *"standard"* ]] + [[ "${output}" == *"tokenizer"* ]] + [[ "${output}" == *"xml"* ]] + [[ "${output}" == *"xmlreader"* ]] + [[ "${output}" == *"xmlwriter"* ]] + [[ "${output}" == *"yaml"* ]] + [[ "${output}" == *"Zend OPcache"* ]] + [[ "${output}" == *"zip"* ]] + [[ "${output}" == *"zlib"* ]] +} diff --git a/8.4/php/conf.d/00_memlimit.ini b/8.4/php/conf.d/00_memlimit.ini new file mode 100644 index 0000000..d0c56ed --- /dev/null +++ b/8.4/php/conf.d/00_memlimit.ini @@ -0,0 +1,3 @@ +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 1024M diff --git a/8.4/php/conf.d/00_short_open_tag.ini b/8.4/php/conf.d/00_short_open_tag.ini new file mode 100644 index 0000000..6f4646c --- /dev/null +++ b/8.4/php/conf.d/00_short_open_tag.ini @@ -0,0 +1,13 @@ +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It's been +; recommended for several years that you not use the short tag "short cut" and +; instead to use the full tag combination. With the wide spread use +; of XML and use of these tags by other languages, the server can become easily +; confused and end up parsing the wrong code in the wrong context. But because +; this short cut has been a feature for such a long time, it's currently still +; supported for backwards compatibility, but we recommend you don't use them. +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/short-open-tag +short_open_tag = On diff --git a/8.4/php_debug.bats b/8.4/php_debug.bats new file mode 100755 index 0000000..acdb3f3 --- /dev/null +++ b/8.4/php_debug.bats @@ -0,0 +1,9 @@ +#!/usr/bin/env bats + +@test "the image has phpdbg" { + run docker run ${container} which phpdbg84 + echo 'status:' $status + echo 'output:' $output + [ "$status" -eq 0 ] + [[ "${output}" == *"phpdbg84"* ]] +} diff --git a/8.4/tags.bats b/8.4/tags.bats new file mode 100644 index 0000000..20530ce --- /dev/null +++ b/8.4/tags.bats @@ -0,0 +1,13 @@ +#!/usr/bin/env bats + +@test "the main tags are created" { + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.4 --format '{{.ID}}')"" + echo 'output:' $output + [[ "$output" == *"(8.4)"* ]] +} + +@test "the test tags are created" { + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.4-test --format '{{.ID}}')"" + echo 'output:' $output + [[ "$output" == *"(8.4-test)"* ]] +} diff --git a/8.5/.dockerignore b/8.5/.dockerignore new file mode 100644 index 0000000..e46b33e --- /dev/null +++ b/8.5/.dockerignore @@ -0,0 +1 @@ +*.bats diff --git a/8.5/Dockerfile b/8.5/Dockerfile new file mode 100644 index 0000000..4714c99 --- /dev/null +++ b/8.5/Dockerfile @@ -0,0 +1,79 @@ +FROM alpine:3.22 + +LABEL maintainer="developers@graze.com" \ + license="MIT" \ + org.label-schema.schema-version="1.0" \ + org.label-schema.vendor="graze" \ + org.label-schema.name="php-alpine" \ + org.label-schema.description="small php image based on alpine" \ + org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" + +# Fix for iconv: https://github.com/docker-library/php/issues/240 +RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted + +RUN set -xe \ + && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.22/community" >> /etc/apk/repositories \ + && apk add --update --no-cache \ + ca-certificates \ + curl \ + gnu-libiconv \ + openssh-client \ + libmemcached-libs \ + libevent \ + libssl3 \ + musl \ + yaml \ + php85 \ + php85-pecl-apcu \ + php85-pecl-event \ + php85-pecl-memcached \ + php85-pecl-yaml \ + php85-bcmath \ + php85-common \ + php85-ctype \ + php85-curl \ + php85-dom \ + php85-fileinfo \ + php85-iconv \ + php85-intl \ + php85-openssl \ + php85-opcache \ + php85-mbstring \ + php85-mysqlnd \ + php85-mysqli \ + php85-pcntl \ + php85-pgsql \ + php85-pdo_mysql \ + php85-pdo_pgsql \ + php85-pdo_sqlite \ + php85-phar \ + php85-posix \ + php85-simplexml \ + php85-session \ + php85-soap \ + php85-sockets \ + php85-sodium \ + php85-tokenizer \ + php85-xml \ + php85-xmlreader \ + php85-xmlwriter \ + php85-zip \ + php85-zlib + +ENV PHP_INI_DIR /etc/php85 + +RUN ln -s /usr/bin/php85 /usr/bin/php +RUN ln -s /usr/bin/pecl85 /usr/bin/pecl + +COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/ + +WORKDIR /srv + +ARG BUILD_DATE +ARG VCS_REF + +LABEL org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.build-date=$BUILD_DATE + +# Fix for iconv: https://github.com/docker-library/php/issues/240 +ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/8.5/debug.Dockerfile b/8.5/debug.Dockerfile new file mode 100644 index 0000000..6f74d98 --- /dev/null +++ b/8.5/debug.Dockerfile @@ -0,0 +1,10 @@ +FROM graze/php-alpine:8.5 + +RUN apk add --update --no-cache \ + php85-phpdbg + +ARG BUILD_DATE +ARG VCS_REF + +LABEL org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.build-date=$BUILD_DATE diff --git a/8.5/php.bats b/8.5/php.bats new file mode 100755 index 0000000..513d006 --- /dev/null +++ b/8.5/php.bats @@ -0,0 +1,64 @@ +#!/usr/bin/env bats + +@test "php version is correct" { + run docker run --rm ${container} php -v + echo 'status:' $status + echo 'output:' $output + version="$(echo $output | sed 's/.*PHP \([0-9].[0-9]\).*/\1/')" + echo 'version:' $version + [ "$status" -eq 0 ] + [[ "$version" == "8.5" ]] +} + +@test "the image has the correct php modules installed" { + run docker run --rm ${container} php -m + echo 'status:' $status + echo 'output:' $output + [ "$status" -eq 0 ] + [[ "${output}" == *"apcu"* ]] + [[ "${output}" == *"bcmath"* ]] + [[ "${output}" == *"Core"* ]] + [[ "${output}" == *"ctype"* ]] + [[ "${output}" == *"curl"* ]] + [[ "${output}" == *"date"* ]] + [[ "${output}" == *"dom"* ]] + [[ "${output}" == *"event"* ]] + [[ "${output}" == *"fileinfo"* ]] + [[ "${output}" == *"filter"* ]] + [[ "${output}" == *"hash"* ]] + [[ "${output}" == *"iconv"* ]] + [[ "${output}" == *"intl"* ]] + [[ "${output}" == *"json"* ]] + [[ "${output}" == *"libxml"* ]] + [[ "${output}" == *"mbstring"* ]] + [[ "${output}" == *"memcached"* ]] + [[ "${output}" == *"mysqli"* ]] + [[ "${output}" == *"mysqlnd"* ]] + [[ "${output}" == *"openssl"* ]] + [[ "${output}" == *"pcre"* ]] + [[ "${output}" == *"pcntl"* ]] + [[ "${output}" == *"PDO"* ]] + [[ "${output}" == *"pdo_mysql"* ]] + [[ "${output}" == *"pdo_pgsql"* ]] + [[ "${output}" == *"pdo_sqlite"* ]] + [[ "${output}" == *"pgsql"* ]] + [[ "${output}" == *"Phar"* ]] + [[ "${output}" == *"posix"* ]] + [[ "${output}" == *"readline"* ]] + [[ "${output}" == *"Reflection"* ]] + [[ "${output}" == *"session"* ]] + [[ "${output}" == *"SimpleXML"* ]] + [[ "${output}" == *"soap"* ]] + [[ "${output}" == *"sodium"* ]] + [[ "${output}" == *"sockets"* ]] + [[ "${output}" == *"SPL"* ]] + [[ "${output}" == *"standard"* ]] + [[ "${output}" == *"tokenizer"* ]] + [[ "${output}" == *"xml"* ]] + [[ "${output}" == *"xmlreader"* ]] + [[ "${output}" == *"xmlwriter"* ]] + [[ "${output}" == *"yaml"* ]] + [[ "${output}" == *"Zend OPcache"* ]] + [[ "${output}" == *"zip"* ]] + [[ "${output}" == *"zlib"* ]] +} diff --git a/8.5/php/conf.d/00_memlimit.ini b/8.5/php/conf.d/00_memlimit.ini new file mode 100644 index 0000000..d0c56ed --- /dev/null +++ b/8.5/php/conf.d/00_memlimit.ini @@ -0,0 +1,3 @@ +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 1024M diff --git a/8.5/php/conf.d/00_short_open_tag.ini b/8.5/php/conf.d/00_short_open_tag.ini new file mode 100644 index 0000000..6f4646c --- /dev/null +++ b/8.5/php/conf.d/00_short_open_tag.ini @@ -0,0 +1,13 @@ +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It's been +; recommended for several years that you not use the short tag "short cut" and +; instead to use the full tag combination. With the wide spread use +; of XML and use of these tags by other languages, the server can become easily +; confused and end up parsing the wrong code in the wrong context. But because +; this short cut has been a feature for such a long time, it's currently still +; supported for backwards compatibility, but we recommend you don't use them. +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/short-open-tag +short_open_tag = On diff --git a/8.5/php_debug.bats b/8.5/php_debug.bats new file mode 100755 index 0000000..1db1730 --- /dev/null +++ b/8.5/php_debug.bats @@ -0,0 +1,9 @@ +#!/usr/bin/env bats + +@test "the image has phpdbg" { + run docker run ${container} which phpdbg85 + echo 'status:' $status + echo 'output:' $output + [ "$status" -eq 0 ] + [[ "${output}" == *"phpdbg85"* ]] +} diff --git a/8.5/tags.bats b/8.5/tags.bats new file mode 100644 index 0000000..f04dfe7 --- /dev/null +++ b/8.5/tags.bats @@ -0,0 +1,13 @@ +#!/usr/bin/env bats + +@test "the main tags are created" { + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.5 --format '{{.ID}}')"" + echo 'output:' $output + [[ "$output" == *"(8.5)"* ]] +} + +@test "the test tags are created" { + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.5-test --format '{{.ID}}')"" + echo 'output:' $output + [[ "$output" == *"(8.5-test)"* ]] +} diff --git a/Makefile b/Makefile index 1fbf1a8..1ea8c85 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,8 @@ build_args := --build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \ latest_5 := 5.6 latest_7 := 7.4 -latest_8 := 8.2 -latest := 8.2 +latest_8 := 8.5 +latest := 8.5 .PHONY: build build-quick .PHONY: tag @@ -30,25 +30,25 @@ latest := 8.2 .PHONY: prod-build prod-build-quick .DEFAULT: build -build: build-5.6 build-7.0 build-7.1 build-7.2 build-7.3 build-7.4 build-8.0 build-8.1 build-8.2 +build: build-5.6 build-7.0 build-7.1 build-7.2 build-7.3 build-7.4 build-8.0 build-8.1 build-8.2 build-8.3 build-8.4 build-8.5 build-quick: make build cache="" pull="" build-quick-%: make build-$* cache="" pull="" -prod-build: prod-build-5.6 prod-build-7.0 prod-build-7.1 prod-build-7.2 prod-build-7.3 prod-build-7.4 prod-build-8.0 prod-build-8.1 prod-build-8.2 +prod-build: prod-build-5.6 prod-build-7.0 prod-build-7.1 prod-build-7.2 prod-build-7.3 prod-build-7.4 prod-build-8.0 prod-build-8.1 prod-build-8.2 prod-build-8.3 prod-build-8.4 prod-build-8.5 prod-build-quick: make prod-build cache="" pull="" prod-build-quick-%: make prod-build-$* cache="" pull="" -tag: tag-5.6 tag-7.0 tag-7.1 tag-7.2 tag-7.3 tag-7.4 tag-8.0 tag-8.1 test-8.2 -test: test-5.6 test-7.0 test-7.1 test-7.2 test-7.3 test-7.4 test-8.0 test-8.1 test-8.2 -push: push-5.6 push-7.0 push-7.1 push-7.2 push-7.3 push-7.4 push-8.0 push-8.1 push-8.2 -clean: clean-5.6 clean-7.0 clean-7.1 clean-7.2 clean-7.3 clean-7.4 clean-8.0 clean-8.1 clean-8.2 -deploy: deploy-5.6 deploy-7.0 deploy-7.1 deploy-7.2 deploy-7.3 deploy-7.4 deploy-8.0 deploy-8.1 deploy-8.2 +tag: tag-5.6 tag-7.0 tag-7.1 tag-7.2 tag-7.3 tag-7.4 tag-8.0 tag-8.1 tag-8.2 tag-8.3 tag-8.4 tag-8.5 +test: test-5.6 test-7.0 test-7.1 test-7.2 test-7.3 test-7.4 test-8.0 test-8.1 test-8.2 test-8.3 test-8.4 test-8.5 +push: push-5.6 push-7.0 push-7.1 push-7.2 push-7.3 push-7.4 push-8.0 push-8.1 push-8.2 push-8.3 push-8.4 push-8.5 +clean: clean-5.6 clean-7.0 clean-7.1 clean-7.2 clean-7.3 clean-7.4 clean-8.0 clean-8.1 clean-8.2 clean-8.3 clean-8.4 clean-8.5 +deploy: deploy-5.6 deploy-7.0 deploy-7.1 deploy-7.2 deploy-7.3 deploy-7.4 deploy-8.0 deploy-8.1 deploy-8.2 deploy-8.3 deploy-8.4 deploy-8.5 build-%: cache ?= --no-cache build-%: pull ?= --pull diff --git a/README.md b/README.md index e6c9f0c..55bd312 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PHP Alpine Base Images -[![Build Status](https://img.shields.io/travis/graze/docker-php-alpine/master.svg)](https://travis-ci.org/graze/docker-php-alpine) +[![Build Status](https://github.com/graze/docker-php-alpine/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/graze/docker-php-alpine/actions/workflows/build.yml) [![Docker Pulls](https://img.shields.io/docker/pulls/graze/php-alpine.svg)](https://hub.docker.com/r/graze/php-alpine/) [![Image Size](https://images.microbadger.com/badges/image/graze/php-alpine.svg)](https://microbadger.com/images/graze/php-alpine) @@ -8,7 +8,12 @@ Public image for php in alpine with a set of common extensions ## Images -- `8.0`, `8`, `latest` [8.0/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.0/Dockerfile) +- `8.5`, `8`, `latest` [8.5/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.5/Dockerfile) +- `8.4` [8.4/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.4/Dockerfile) +- `8.3` [8.3/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.3/Dockerfile) +- `8.2` [8.2/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.2/Dockerfile) +- `8.1` [8.1/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.1/Dockerfile) +- `8.0` [8.0/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.0/Dockerfile) - `7.4`, `7` [7.4/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/7.4/Dockerfile) - `7.3` [7.3/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/7.3/Dockerfile) - `7.2` [7.2/Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/7.2/Dockerfile) @@ -45,7 +50,12 @@ standard, [tokenizer](http://php.net/manual/en/book.tokenizer.php), [xml](http:/ Testing images are the same as the standard, but with xdebug (php 5.6) or phpdbg (php 7.* and 8.*) -- `8.0-test`, `8-test`, `test` [8.0/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.0/debug.Dockerfile) +- `8.5-test`, `8-test`, `test` [8.5/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.5/debug.Dockerfile) +- `8.4-test` [8.4/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.4/debug.Dockerfile) +- `8.3-test` [8.3/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.3/debug.Dockerfile) +- `8.2-test` [8.2/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.2/debug.Dockerfile) +- `8.1-test` [8.1/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.1/debug.Dockerfile) +- `8.0-test` [8.0/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/8.0/debug.Dockerfile) - `7.4-test`, `7-test` [7.4/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/7.4/debug.Dockerfile) - `7.3-test` [7.3/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/7.3/debug.Dockerfile) - `7.2-test` [7.2/debug.Dockerfile](https://github.com/graze/docker-php-alpine/blob/master/7.2/debug.Dockerfile) From d95803c0c13c03f0976e90ba2b8667e0e19c85b9 Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 13:39:06 +0100 Subject: [PATCH 02/15] ci: build single-arch in GH Actions so image loads into daemon The Makefile defaults build-% to multi-platform, which is incompatible with --output=type=docker (manifest lists can't be exported into the local Docker daemon). The bats tests need the image in the daemon, so pin platform=linux/amd64 for the CI build step. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8f5dbc..d347703 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: uses: docker/setup-buildx-action@v4 - name: Build - run: make build-${{ matrix.version }} + run: make build-${{ matrix.version }} platform=--platform=linux/amd64 - name: Tag run: make tag-${{ matrix.version }} From efe15b42cf4f94932d7a948bce0b662cb75d1acb Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 13:43:40 +0100 Subject: [PATCH 03/15] ci: multi-arch publish per supported alpine base Build single-arch (amd64) for the test step so the bats suite can load the image into the local Docker daemon, then run a second multi-arch buildx build with --push directly to Docker Hub on master. Platform set per PHP version matches what the underlying alpine base image supports: 5.6, 7.0 alpine:3.5 amd64 7.1, 7.2 alpine:3.7/3.8 amd64 7.3 ... 8.5 alpine:3.12+ amd64, arm/v7, arm64 The deploy step also computes the floating aliases (5/7/8/latest and their -test variants) inline rather than via make tag-/push-, since those targets work on the local daemon and can't manage multi-arch manifest lists. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build.yml | 81 +++++++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d347703..47769b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,19 +13,31 @@ jobs: strategy: fail-fast: false matrix: - version: - - "5.6" - - "7.0" - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - - "8.1" - - "8.2" - - "8.3" - - "8.4" - - "8.5" + include: + - version: "5.6" + platforms: "linux/amd64" + - version: "7.0" + platforms: "linux/amd64" + - version: "7.1" + platforms: "linux/amd64" + - version: "7.2" + platforms: "linux/amd64" + - version: "7.3" + platforms: "linux/amd64,linux/arm/v7,linux/arm64" + - version: "7.4" + platforms: "linux/amd64,linux/arm/v7,linux/arm64" + - version: "8.0" + platforms: "linux/amd64,linux/arm/v7,linux/arm64" + - version: "8.1" + platforms: "linux/amd64,linux/arm/v7,linux/arm64" + - version: "8.2" + platforms: "linux/amd64,linux/arm/v7,linux/arm64" + - version: "8.3" + platforms: "linux/amd64,linux/arm/v7,linux/arm64" + - version: "8.4" + platforms: "linux/amd64,linux/arm/v7,linux/arm64" + - version: "8.5" + platforms: "linux/amd64,linux/arm/v7,linux/arm64" steps: - uses: actions/checkout@v6 @@ -35,7 +47,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - - name: Build + - name: Build (single-arch for tests) run: make build-${{ matrix.version }} platform=--platform=linux/amd64 - name: Tag @@ -51,6 +63,43 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Deploy + - name: Build and push (multi-arch) if: github.ref == 'refs/heads/master' && github.event_name == 'push' - run: make deploy-${{ matrix.version }} + run: | + V="${{ matrix.version }}" + BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" + VCS_REF="$(git rev-parse --short HEAD)" + + main_tags="-t graze/php-alpine:${V}" + test_tags="-t graze/php-alpine:${V}-test" + case "$V" in + 5.6) + main_tags="$main_tags -t graze/php-alpine:5" + test_tags="$test_tags -t graze/php-alpine:5-test" + ;; + 7.4) + main_tags="$main_tags -t graze/php-alpine:7" + test_tags="$test_tags -t graze/php-alpine:7-test" + ;; + 8.5) + main_tags="$main_tags -t graze/php-alpine:8 -t graze/php-alpine:latest" + test_tags="$test_tags -t graze/php-alpine:8-test -t graze/php-alpine:test" + ;; + esac + + docker buildx build \ + --push \ + --platform=${{ matrix.platforms }} \ + --build-arg BUILD_DATE="$BUILD_DATE" \ + --build-arg VCS_REF="$VCS_REF" \ + $main_tags \ + "./$V" + + docker buildx build \ + --push \ + --platform=${{ matrix.platforms }} \ + --build-arg BUILD_DATE="$BUILD_DATE" \ + --build-arg VCS_REF="$VCS_REF" \ + -f "./$V/debug.Dockerfile" \ + $test_tags \ + "./$V" From 3d77ef4b95125a6b794d68f874082cdde60afb89 Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 13:51:38 +0100 Subject: [PATCH 04/15] ci: fix build/test failures across the matrix - 8.5: bump alpine 3.22 -> 3.23; php85 is only in 3.23/community - Move setup-buildx-action to the deploy step only. The default docker driver is single-platform but shares images with the daemon, so the debug image (FROM graze/php-alpine:VER) can resolve the just-built base. setup-buildx-action creates a docker-container builder that can't see daemon images, which broke the debug build for any version whose tag wasn't already on Docker Hub (8.3, 8.4). - Pass GIT_CONFIG_COUNT/KEY/VALUE to the bats container so git inside the container treats the host-owned mount as a safe.directory; fixes the "dubious ownership in repository at '/app'" failure in every test. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build.yml | 17 +++++++++++------ 8.5/Dockerfile | 4 ++-- Makefile | 3 +++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47769b8..b6f4c7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,12 +41,9 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Set up QEMU - uses: docker/setup-qemu-action@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 - + # Test phase uses the default docker driver so the debug image's + # `FROM graze/php-alpine:VER` can resolve the just-built base from + # the local daemon. The docker driver is single-platform only. - name: Build (single-arch for tests) run: make build-${{ matrix.version }} platform=--platform=linux/amd64 @@ -56,6 +53,14 @@ jobs: - name: Test run: make test-${{ matrix.version }} + - name: Set up QEMU + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + uses: docker/setup-qemu-action@v4 + + - name: Set up Docker Buildx + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + uses: docker/setup-buildx-action@v4 + - name: Login to Docker Hub if: github.ref == 'refs/heads/master' && github.event_name == 'push' uses: docker/login-action@v4 diff --git a/8.5/Dockerfile b/8.5/Dockerfile index 4714c99..5a84bac 100644 --- a/8.5/Dockerfile +++ b/8.5/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.22 +FROM alpine:3.23 LABEL maintainer="developers@graze.com" \ license="MIT" \ @@ -12,7 +12,7 @@ LABEL maintainer="developers@graze.com" \ RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted RUN set -xe \ - && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.22/community" >> /etc/apk/repositories \ + && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.23/community" >> /etc/apk/repositories \ && apk add --update --no-cache \ ca-certificates \ curl \ diff --git a/Makefile b/Makefile index 1ea8c85..9f0046b 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ docker_bats := docker run --rm \ --platform linux/${PLATFORM} \ -v $$(pwd):/app -v /var/run/docker.sock:/var/run/docker.sock \ -e container \ + -e GIT_CONFIG_COUNT=1 \ + -e GIT_CONFIG_KEY_0=safe.directory \ + -e GIT_CONFIG_VALUE_0=* \ graze/bats build_args := --build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \ From 1b5005c410493b8f744c9b8a550ca7cb1dac58d0 Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 13:57:58 +0100 Subject: [PATCH 05/15] ci: drop unavailable 8.5 packages and fix 8.1/8.2 tag tests - alpine:3.23/community does not package php85-opcache or php85-zlib; remove them from 8.5/Dockerfile and drop the corresponding asserts from 8.5/php.bats. - 8.1/tags.bats and 8.2/tags.bats reference graze/php-alpine:8.0 when looking up image IDs. Travis built every PHP version in the same workspace so 8.0 happened to be present, but per-job isolation in GitHub Actions means the test runs without an 8.0 image and grep receives an empty pattern. Point each test at its own version. Co-Authored-By: Claude Opus 4.7 (1M context) --- 8.1/tags.bats | 4 ++-- 8.2/tags.bats | 4 ++-- 8.5/Dockerfile | 4 +--- 8.5/php.bats | 2 -- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/8.1/tags.bats b/8.1/tags.bats index 19eb11e..c970acf 100644 --- a/8.1/tags.bats +++ b/8.1/tags.bats @@ -1,13 +1,13 @@ #!/usr/bin/env bats @test "the main tags are created" { - run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.0 --format '{{.ID}}')"" + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.1 --format '{{.ID}}')"" echo 'output:' $output [[ "$output" == *"(8.1)"* ]] } @test "the test tags are created" { - run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.0-test --format '{{.ID}}')"" + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.1-test --format '{{.ID}}')"" echo 'output:' $output [[ "$output" == *"(8.1-test)"* ]] } diff --git a/8.2/tags.bats b/8.2/tags.bats index 11f2c80..fd22ea8 100644 --- a/8.2/tags.bats +++ b/8.2/tags.bats @@ -1,13 +1,13 @@ #!/usr/bin/env bats @test "the main tags are created" { - run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.0 --format '{{.ID}}')"" + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.2 --format '{{.ID}}')"" echo 'output:' $output [[ "$output" == *"(8.2)"* ]] } @test "the test tags are created" { - run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.0-test --format '{{.ID}}')"" + run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.2-test --format '{{.ID}}')"" echo 'output:' $output [[ "$output" == *"(8.2-test)"* ]] } diff --git a/8.5/Dockerfile b/8.5/Dockerfile index 5a84bac..740297d 100644 --- a/8.5/Dockerfile +++ b/8.5/Dockerfile @@ -37,7 +37,6 @@ RUN set -xe \ php85-iconv \ php85-intl \ php85-openssl \ - php85-opcache \ php85-mbstring \ php85-mysqlnd \ php85-mysqli \ @@ -57,8 +56,7 @@ RUN set -xe \ php85-xml \ php85-xmlreader \ php85-xmlwriter \ - php85-zip \ - php85-zlib + php85-zip ENV PHP_INI_DIR /etc/php85 diff --git a/8.5/php.bats b/8.5/php.bats index 513d006..c5461da 100755 --- a/8.5/php.bats +++ b/8.5/php.bats @@ -58,7 +58,5 @@ [[ "${output}" == *"xmlreader"* ]] [[ "${output}" == *"xmlwriter"* ]] [[ "${output}" == *"yaml"* ]] - [[ "${output}" == *"Zend OPcache"* ]] [[ "${output}" == *"zip"* ]] - [[ "${output}" == *"zlib"* ]] } From c5a47c638e1d7cb5d48fc0da3f9b8f04ce6126c1 Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 14:01:01 +0100 Subject: [PATCH 06/15] ci: match memory_limit on whole word PHP 8.5 introduced a new max_memory_limit INI directive, so the existing `grep memory_limit` returns two lines instead of one and the equality assertion fails. Switch to `grep -w` so only the exact memory_limit row is matched across every PHP version. Co-Authored-By: Claude Opus 4.7 (1M context) --- common/php.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/php.bats b/common/php.bats index 9bdbfd1..68fbb9f 100755 --- a/common/php.bats +++ b/common/php.bats @@ -82,7 +82,7 @@ } @test "php should have a memory limit of 1024M" { - run bash -c "docker run --rm ${container} php -i | grep memory_limit" + run bash -c "docker run --rm ${container} php -i | grep -w memory_limit" echo "status: $status" echo "output: $output" [ "$status" -eq 0 ] From 885342c8d027d74f92e34ff5321a06e51e7aeacc Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 14:10:19 +0100 Subject: [PATCH 07/15] Restore php85-zlib (provided as virtual by php85-common) php85-zlib doesn't exist as a real apk package in alpine 3.23, but php85-common's `provides:` list includes php85-zlib (zlib was merged into php-common upstream). Installing it via the virtual still works, so list it explicitly to keep the package set consistent with the other PHP versions, and restore the zlib assertion in 8.5/php.bats. php85-opcache stays removed because it's neither a real package nor provided by anything in alpine 3.23. Co-Authored-By: Claude Opus 4.7 (1M context) --- 8.5/Dockerfile | 3 ++- 8.5/php.bats | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/8.5/Dockerfile b/8.5/Dockerfile index 740297d..f8fa28c 100644 --- a/8.5/Dockerfile +++ b/8.5/Dockerfile @@ -56,7 +56,8 @@ RUN set -xe \ php85-xml \ php85-xmlreader \ php85-xmlwriter \ - php85-zip + php85-zip \ + php85-zlib ENV PHP_INI_DIR /etc/php85 diff --git a/8.5/php.bats b/8.5/php.bats index c5461da..23aaa20 100755 --- a/8.5/php.bats +++ b/8.5/php.bats @@ -59,4 +59,5 @@ [[ "${output}" == *"xmlwriter"* ]] [[ "${output}" == *"yaml"* ]] [[ "${output}" == *"zip"* ]] + [[ "${output}" == *"zlib"* ]] } From 8bc882eb9600b6aac5542c5322cc18948b9eae2c Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 14:14:54 +0100 Subject: [PATCH 08/15] test: assert 8 / latest aliases on 8.5 tag test make tag-8.5 reassigns the aggregate tags (8, 8-test, latest, test) to the 8.5 image but nothing was verifying that. Extend the tags bats file so the same docker-images lookup also asserts the alias tags are present alongside the versioned 8.5 / 8.5-test tags. Co-Authored-By: Claude Opus 4.7 (1M context) --- 8.5/tags.bats | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/8.5/tags.bats b/8.5/tags.bats index f04dfe7..1ab4426 100644 --- a/8.5/tags.bats +++ b/8.5/tags.bats @@ -4,10 +4,14 @@ run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.5 --format '{{.ID}}')"" echo 'output:' $output [[ "$output" == *"(8.5)"* ]] + [[ "$output" == *"(8)"* ]] + [[ "$output" == *"(latest)"* ]] } @test "the test tags are created" { run bash -c "docker images graze/php-alpine --format '{{.ID}} ({{.Tag}})' | grep "$(docker images graze/php-alpine:8.5-test --format '{{.ID}}')"" echo 'output:' $output [[ "$output" == *"(8.5-test)"* ]] + [[ "$output" == *"(8-test)"* ]] + [[ "$output" == *"(test)"* ]] } From c3128bf006cc36435320a6f7c5433e8f263cf309 Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 14:32:21 +0100 Subject: [PATCH 09/15] Install historical alpine key instead of --allow-untrusted for gnu-libiconv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gnu-libiconv 1.15-r3 is the last release that ships the LD_PRELOAD- compatible preloadable_libiconv.so, and that file is what makes PHP's iconv extension pick up GNU iconv's //TRANSLIT support at runtime without rebuilding PHP from source. We still have to pull the .apk from alpine 3.13/community, but rather than passing --allow-untrusted and HTTP we now: - fetch the alpine-devel 4a6a0840 signing key over HTTPS from aports and verify it against a pinned sha256 - drop the key into /etc/apk/keys/ - use the HTTPS mirror for the 3.13 community repository apk can now verify the package signature normally, --allow-untrusted is gone, and the transport is TLS-protected. Verified locally that iconv("UTF-8", "ASCII//TRANSLIT", "café") still transliterates. Co-Authored-By: Claude Opus 4.7 (1M context) --- 8.3/Dockerfile | 10 +++++++++- 8.4/Dockerfile | 10 +++++++++- 8.5/Dockerfile | 10 +++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/8.3/Dockerfile b/8.3/Dockerfile index 2ba152b..397a698 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -9,7 +9,15 @@ LABEL maintainer="developers@graze.com" \ org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" # Fix for iconv: https://github.com/docker-library/php/issues/240 -RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted +# gnu-libiconv 1.15-r3 is the last release that ships the LD_PRELOAD-compatible +# preloadable_libiconv.so; pull it from alpine 3.13/community over HTTPS and +# install the historical alpine signing key (pinned by sha256) so we don't need +# --allow-untrusted. +RUN set -xe \ + && wget -qO /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ + https://raw.githubusercontent.com/alpinelinux/aports/master/main/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ + && echo "9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4 /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub" | sha256sum -c - \ + && apk add gnu-libiconv=1.15-r3 --update-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.13/community/ RUN set -xe \ && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.19/community" >> /etc/apk/repositories \ diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 991e3b4..beb2c91 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -9,7 +9,15 @@ LABEL maintainer="developers@graze.com" \ org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" # Fix for iconv: https://github.com/docker-library/php/issues/240 -RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted +# gnu-libiconv 1.15-r3 is the last release that ships the LD_PRELOAD-compatible +# preloadable_libiconv.so; pull it from alpine 3.13/community over HTTPS and +# install the historical alpine signing key (pinned by sha256) so we don't need +# --allow-untrusted. +RUN set -xe \ + && wget -qO /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ + https://raw.githubusercontent.com/alpinelinux/aports/master/main/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ + && echo "9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4 /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub" | sha256sum -c - \ + && apk add gnu-libiconv=1.15-r3 --update-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.13/community/ RUN set -xe \ && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.21/community" >> /etc/apk/repositories \ diff --git a/8.5/Dockerfile b/8.5/Dockerfile index f8fa28c..f74096a 100644 --- a/8.5/Dockerfile +++ b/8.5/Dockerfile @@ -9,7 +9,15 @@ LABEL maintainer="developers@graze.com" \ org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" # Fix for iconv: https://github.com/docker-library/php/issues/240 -RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted +# gnu-libiconv 1.15-r3 is the last release that ships the LD_PRELOAD-compatible +# preloadable_libiconv.so; pull it from alpine 3.13/community over HTTPS and +# install the historical alpine signing key (pinned by sha256) so we don't need +# --allow-untrusted. +RUN set -xe \ + && wget -qO /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ + https://raw.githubusercontent.com/alpinelinux/aports/master/main/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ + && echo "9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4 /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub" | sha256sum -c - \ + && apk add gnu-libiconv=1.15-r3 --update-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.13/community/ RUN set -xe \ && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.23/community" >> /etc/apk/repositories \ From 7e5b75858fb645858cc0f4830024aedfedebcc6a Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 15:30:11 +0100 Subject: [PATCH 10/15] Rebase 8.3-8.5 on docker-library php-cli-alpine images Replace the apk phpXX-based 8.3/8.4/8.5 Dockerfiles with builds that inherit from php:X.Y-cli-alpine. The upstream PHP images compile PHP from source linked against the current alpine gnu-libiconv package (--with-iconv=/usr after rm /usr/include/iconv.h), so the LD_PRELOAD preloadable_libiconv.so workaround and the alpine-3.13/community package pull go away entirely. iconv //TRANSLIT keeps working. What changed per Dockerfile: - FROM php:X.Y-cli-alpine3.NN (3.19 / 3.21 / 3.23). - docker-php-ext-install bcmath intl mysqli pcntl pdo_mysql pdo_pgsql pgsql soap sockets zip; pecl install apcu event memcached yaml. - event's .ini is forced to load after sockets via the zz- prefix (event references sockets symbols at runtime). - ENTRYPOINT [] resets the upstream docker-php-entrypoint so the "empty entrypoint" bats assertion keeps passing. debug.Dockerfile becomes a passthrough since php-cli-alpine already ships phpdbg, and php_debug.bats now greps for the unversioned binary. common/php.bats drops the LD_PRELOAD env-var assertion (no longer present on 8.3+) and the "iconv works" test now uses non-ASCII input so it actually exercises //TRANSLIT for every PHP version. Co-Authored-By: Claude Opus 4.7 (1M context) --- 8.3/Dockerfile | 107 ++++++++++++++++--------------------------- 8.3/debug.Dockerfile | 6 ++- 8.3/php_debug.bats | 4 +- 8.4/Dockerfile | 107 ++++++++++++++++--------------------------- 8.4/debug.Dockerfile | 6 ++- 8.4/php_debug.bats | 4 +- 8.5/Dockerfile | 106 ++++++++++++++++-------------------------- 8.5/debug.Dockerfile | 6 ++- 8.5/php.bats | 1 + 8.5/php_debug.bats | 4 +- common/php.bats | 15 ++---- 11 files changed, 143 insertions(+), 223 deletions(-) diff --git a/8.3/Dockerfile b/8.3/Dockerfile index 397a698..ded59ab 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.19 +FROM php:8.3-cli-alpine3.19 LABEL maintainer="developers@graze.com" \ license="MIT" \ @@ -8,80 +8,53 @@ LABEL maintainer="developers@graze.com" \ org.label-schema.description="small php image based on alpine" \ org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" -# Fix for iconv: https://github.com/docker-library/php/issues/240 -# gnu-libiconv 1.15-r3 is the last release that ships the LD_PRELOAD-compatible -# preloadable_libiconv.so; pull it from alpine 3.13/community over HTTPS and -# install the historical alpine signing key (pinned by sha256) so we don't need -# --allow-untrusted. RUN set -xe \ - && wget -qO /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ - https://raw.githubusercontent.com/alpinelinux/aports/master/main/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ - && echo "9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4 /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub" | sha256sum -c - \ - && apk add gnu-libiconv=1.15-r3 --update-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.13/community/ - -RUN set -xe \ - && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.19/community" >> /etc/apk/repositories \ - && apk add --update --no-cache \ - ca-certificates \ - curl \ - gnu-libiconv \ - openssh-client \ - libmemcached-libs \ - libevent \ - libssl3 \ - musl \ - yaml \ - php83 \ - php83-pecl-apcu \ - php83-pecl-event \ - php83-pecl-memcached \ - php83-pecl-yaml \ - php83-bcmath \ - php83-common \ - php83-ctype \ - php83-curl \ - php83-dom \ - php83-fileinfo \ - php83-iconv \ - php83-intl \ - php83-openssl \ - php83-opcache \ - php83-mbstring \ - php83-mysqlnd \ - php83-mysqli \ - php83-pcntl \ - php83-pgsql \ - php83-pdo_mysql \ - php83-pdo_pgsql \ - php83-pdo_sqlite \ - php83-phar \ - php83-posix \ - php83-simplexml \ - php83-session \ - php83-soap \ - php83-sockets \ - php83-sodium \ - php83-tokenizer \ - php83-xml \ - php83-xmlreader \ - php83-xmlwriter \ - php83-zip \ - php83-zlib - -ENV PHP_INI_DIR /etc/php83 - -RUN ln -s /usr/bin/php83 /usr/bin/php -RUN ln -s /usr/bin/pecl83 /usr/bin/pecl + && apk add --no-cache \ + openssh-client \ + icu-libs \ + libevent \ + libmemcached-libs \ + libpq \ + libzip \ + yaml \ + && apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + icu-dev \ + libevent-dev \ + libmemcached-dev \ + libxml2-dev \ + libzip-dev \ + linux-headers \ + postgresql-dev \ + yaml-dev \ + zlib-dev \ + && docker-php-ext-install -j$(nproc) \ + bcmath \ + intl \ + mysqli \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + soap \ + sockets \ + zip \ + && yes '' | pecl install apcu event memcached yaml \ + && docker-php-ext-enable apcu memcached yaml sodium \ + # event must load after sockets, hence the zz- prefix + && docker-php-ext-enable --ini-name zz-docker-php-ext-event.ini event \ + && apk del --no-network .build-deps \ + && rm -rf /tmp/pear ~/.pearrc COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/ WORKDIR /srv +# Restore the historical empty-entrypoint behaviour of this image +ENTRYPOINT [] + ARG BUILD_DATE ARG VCS_REF LABEL org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.build-date=$BUILD_DATE - -# Fix for iconv: https://github.com/docker-library/php/issues/240 -ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/8.3/debug.Dockerfile b/8.3/debug.Dockerfile index 58d3d1f..1bc6a24 100644 --- a/8.3/debug.Dockerfile +++ b/8.3/debug.Dockerfile @@ -1,7 +1,9 @@ FROM graze/php-alpine:8.3 -RUN apk add --update --no-cache \ - php83-phpdbg +# The base image is built FROM php:8.3-cli-alpine which ships phpdbg as +# part of the PHP build, so no extra packages are needed for the test +# variant. This Dockerfile exists so we still produce a separate +# graze/php-alpine:8.3-test tag. ARG BUILD_DATE ARG VCS_REF diff --git a/8.3/php_debug.bats b/8.3/php_debug.bats index b226611..c9a8912 100755 --- a/8.3/php_debug.bats +++ b/8.3/php_debug.bats @@ -1,9 +1,9 @@ #!/usr/bin/env bats @test "the image has phpdbg" { - run docker run ${container} which phpdbg83 + run docker run ${container} which phpdbg echo 'status:' $status echo 'output:' $output [ "$status" -eq 0 ] - [[ "${output}" == *"phpdbg83"* ]] + [[ "${output}" == *"phpdbg"* ]] } diff --git a/8.4/Dockerfile b/8.4/Dockerfile index beb2c91..1bca5ba 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.21 +FROM php:8.4-cli-alpine3.21 LABEL maintainer="developers@graze.com" \ license="MIT" \ @@ -8,80 +8,53 @@ LABEL maintainer="developers@graze.com" \ org.label-schema.description="small php image based on alpine" \ org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" -# Fix for iconv: https://github.com/docker-library/php/issues/240 -# gnu-libiconv 1.15-r3 is the last release that ships the LD_PRELOAD-compatible -# preloadable_libiconv.so; pull it from alpine 3.13/community over HTTPS and -# install the historical alpine signing key (pinned by sha256) so we don't need -# --allow-untrusted. RUN set -xe \ - && wget -qO /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ - https://raw.githubusercontent.com/alpinelinux/aports/master/main/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ - && echo "9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4 /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub" | sha256sum -c - \ - && apk add gnu-libiconv=1.15-r3 --update-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.13/community/ - -RUN set -xe \ - && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.21/community" >> /etc/apk/repositories \ - && apk add --update --no-cache \ - ca-certificates \ - curl \ - gnu-libiconv \ - openssh-client \ - libmemcached-libs \ - libevent \ - libssl3 \ - musl \ - yaml \ - php84 \ - php84-pecl-apcu \ - php84-pecl-event \ - php84-pecl-memcached \ - php84-pecl-yaml \ - php84-bcmath \ - php84-common \ - php84-ctype \ - php84-curl \ - php84-dom \ - php84-fileinfo \ - php84-iconv \ - php84-intl \ - php84-openssl \ - php84-opcache \ - php84-mbstring \ - php84-mysqlnd \ - php84-mysqli \ - php84-pcntl \ - php84-pgsql \ - php84-pdo_mysql \ - php84-pdo_pgsql \ - php84-pdo_sqlite \ - php84-phar \ - php84-posix \ - php84-simplexml \ - php84-session \ - php84-soap \ - php84-sockets \ - php84-sodium \ - php84-tokenizer \ - php84-xml \ - php84-xmlreader \ - php84-xmlwriter \ - php84-zip \ - php84-zlib - -ENV PHP_INI_DIR /etc/php84 - -RUN ln -s /usr/bin/php84 /usr/bin/php -RUN ln -s /usr/bin/pecl84 /usr/bin/pecl + && apk add --no-cache \ + openssh-client \ + icu-libs \ + libevent \ + libmemcached-libs \ + libpq \ + libzip \ + yaml \ + && apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + icu-dev \ + libevent-dev \ + libmemcached-dev \ + libxml2-dev \ + libzip-dev \ + linux-headers \ + postgresql-dev \ + yaml-dev \ + zlib-dev \ + && docker-php-ext-install -j$(nproc) \ + bcmath \ + intl \ + mysqli \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + soap \ + sockets \ + zip \ + && yes '' | pecl install apcu event memcached yaml \ + && docker-php-ext-enable apcu memcached yaml sodium \ + # event must load after sockets, hence the zz- prefix + && docker-php-ext-enable --ini-name zz-docker-php-ext-event.ini event \ + && apk del --no-network .build-deps \ + && rm -rf /tmp/pear ~/.pearrc COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/ WORKDIR /srv +# Restore the historical empty-entrypoint behaviour of this image +ENTRYPOINT [] + ARG BUILD_DATE ARG VCS_REF LABEL org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.build-date=$BUILD_DATE - -# Fix for iconv: https://github.com/docker-library/php/issues/240 -ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/8.4/debug.Dockerfile b/8.4/debug.Dockerfile index 0f6f34c..c0b7eee 100644 --- a/8.4/debug.Dockerfile +++ b/8.4/debug.Dockerfile @@ -1,7 +1,9 @@ FROM graze/php-alpine:8.4 -RUN apk add --update --no-cache \ - php84-phpdbg +# The base image is built FROM php:8.4-cli-alpine which ships phpdbg as +# part of the PHP build, so no extra packages are needed for the test +# variant. This Dockerfile exists so we still produce a separate +# graze/php-alpine:8.4-test tag. ARG BUILD_DATE ARG VCS_REF diff --git a/8.4/php_debug.bats b/8.4/php_debug.bats index acdb3f3..c9a8912 100755 --- a/8.4/php_debug.bats +++ b/8.4/php_debug.bats @@ -1,9 +1,9 @@ #!/usr/bin/env bats @test "the image has phpdbg" { - run docker run ${container} which phpdbg84 + run docker run ${container} which phpdbg echo 'status:' $status echo 'output:' $output [ "$status" -eq 0 ] - [[ "${output}" == *"phpdbg84"* ]] + [[ "${output}" == *"phpdbg"* ]] } diff --git a/8.5/Dockerfile b/8.5/Dockerfile index f74096a..39a5edd 100644 --- a/8.5/Dockerfile +++ b/8.5/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.23 +FROM php:8.5-cli-alpine3.23 LABEL maintainer="developers@graze.com" \ license="MIT" \ @@ -8,79 +8,53 @@ LABEL maintainer="developers@graze.com" \ org.label-schema.description="small php image based on alpine" \ org.label-schema.vcs-url="https://github.com/graze/docker-php-alpine" -# Fix for iconv: https://github.com/docker-library/php/issues/240 -# gnu-libiconv 1.15-r3 is the last release that ships the LD_PRELOAD-compatible -# preloadable_libiconv.so; pull it from alpine 3.13/community over HTTPS and -# install the historical alpine signing key (pinned by sha256) so we don't need -# --allow-untrusted. RUN set -xe \ - && wget -qO /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ - https://raw.githubusercontent.com/alpinelinux/aports/master/main/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub \ - && echo "9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4 /etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub" | sha256sum -c - \ - && apk add gnu-libiconv=1.15-r3 --update-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.13/community/ - -RUN set -xe \ - && echo "@php http://dl-cdn.alpinelinux.org/alpine/v3.23/community" >> /etc/apk/repositories \ - && apk add --update --no-cache \ - ca-certificates \ - curl \ - gnu-libiconv \ - openssh-client \ - libmemcached-libs \ - libevent \ - libssl3 \ - musl \ - yaml \ - php85 \ - php85-pecl-apcu \ - php85-pecl-event \ - php85-pecl-memcached \ - php85-pecl-yaml \ - php85-bcmath \ - php85-common \ - php85-ctype \ - php85-curl \ - php85-dom \ - php85-fileinfo \ - php85-iconv \ - php85-intl \ - php85-openssl \ - php85-mbstring \ - php85-mysqlnd \ - php85-mysqli \ - php85-pcntl \ - php85-pgsql \ - php85-pdo_mysql \ - php85-pdo_pgsql \ - php85-pdo_sqlite \ - php85-phar \ - php85-posix \ - php85-simplexml \ - php85-session \ - php85-soap \ - php85-sockets \ - php85-sodium \ - php85-tokenizer \ - php85-xml \ - php85-xmlreader \ - php85-xmlwriter \ - php85-zip \ - php85-zlib - -ENV PHP_INI_DIR /etc/php85 - -RUN ln -s /usr/bin/php85 /usr/bin/php -RUN ln -s /usr/bin/pecl85 /usr/bin/pecl + && apk add --no-cache \ + openssh-client \ + icu-libs \ + libevent \ + libmemcached-libs \ + libpq \ + libzip \ + yaml \ + && apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + icu-dev \ + libevent-dev \ + libmemcached-dev \ + libxml2-dev \ + libzip-dev \ + linux-headers \ + postgresql-dev \ + yaml-dev \ + zlib-dev \ + && docker-php-ext-install -j$(nproc) \ + bcmath \ + intl \ + mysqli \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + soap \ + sockets \ + zip \ + && yes '' | pecl install apcu event memcached yaml \ + && docker-php-ext-enable apcu memcached yaml sodium \ + # event must load after sockets, hence the zz- prefix + && docker-php-ext-enable --ini-name zz-docker-php-ext-event.ini event \ + && apk del --no-network .build-deps \ + && rm -rf /tmp/pear ~/.pearrc COPY php/conf.d/*.ini $PHP_INI_DIR/conf.d/ WORKDIR /srv +# Restore the historical empty-entrypoint behaviour of this image +ENTRYPOINT [] + ARG BUILD_DATE ARG VCS_REF LABEL org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.build-date=$BUILD_DATE - -# Fix for iconv: https://github.com/docker-library/php/issues/240 -ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php diff --git a/8.5/debug.Dockerfile b/8.5/debug.Dockerfile index 6f74d98..5312193 100644 --- a/8.5/debug.Dockerfile +++ b/8.5/debug.Dockerfile @@ -1,7 +1,9 @@ FROM graze/php-alpine:8.5 -RUN apk add --update --no-cache \ - php85-phpdbg +# The base image is built FROM php:8.5-cli-alpine which ships phpdbg as +# part of the PHP build, so no extra packages are needed for the test +# variant. This Dockerfile exists so we still produce a separate +# graze/php-alpine:8.5-test tag. ARG BUILD_DATE ARG VCS_REF diff --git a/8.5/php.bats b/8.5/php.bats index 23aaa20..513d006 100755 --- a/8.5/php.bats +++ b/8.5/php.bats @@ -58,6 +58,7 @@ [[ "${output}" == *"xmlreader"* ]] [[ "${output}" == *"xmlwriter"* ]] [[ "${output}" == *"yaml"* ]] + [[ "${output}" == *"Zend OPcache"* ]] [[ "${output}" == *"zip"* ]] [[ "${output}" == *"zlib"* ]] } diff --git a/8.5/php_debug.bats b/8.5/php_debug.bats index 1db1730..c9a8912 100755 --- a/8.5/php_debug.bats +++ b/8.5/php_debug.bats @@ -1,9 +1,9 @@ #!/usr/bin/env bats @test "the image has phpdbg" { - run docker run ${container} which phpdbg85 + run docker run ${container} which phpdbg echo 'status:' $status echo 'output:' $output [ "$status" -eq 0 ] - [[ "${output}" == *"phpdbg85"* ]] + [[ "${output}" == *"phpdbg"* ]] } diff --git a/common/php.bats b/common/php.bats index 68fbb9f..28d9b1a 100755 --- a/common/php.bats +++ b/common/php.bats @@ -89,20 +89,13 @@ [ "$output" = "memory_limit => 1024M => 1024M" ] } -@test "the image uses a fixed iconv module" { - run bash -c "docker inspect ${container} | jq -r '.[]?.Config.Env[]'" +@test "iconv //TRANSLIT works" { + run docker run ${container} php -r 'echo iconv("UTF-8", "ASCII//TRANSLIT", "café");' echo "status: $status" echo "output: $output" [ "$status" -eq 0 ] - [[ "${output}" == *"LD_PRELOAD=/usr/lib/preloadable_libiconv.so php"* ]] -} - -@test "iconv works" { - run docker run ${container} php -r 'echo iconv("UTF-8", "ASCII//TRANSLIT", "foobar");' - echo "status: $status" - echo "output: $output" - [ "$status" -eq 0 ] - [ "$output" = "foobar" ] + [ "$output" = "caf'e" ] + [[ "${output}" != *"PHP Warning"* ]] [[ "${output}" != *"PHP Notice"* ]] } From 50f675cbd862892912b113027edf7978bd594ea3 Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 15:37:52 +0100 Subject: [PATCH 11/15] 8.3: enable opcache shared module Unlike upstream's php:8.4-cli-alpine (which auto-enables opcache via a docker-php-ext-opcache.ini in conf.d) and php:8.5-cli-alpine (which compiles opcache directly into PHP core), the 8.3 base ships opcache only as an installable shared module. Add it to the docker-php-ext- enable list so the "Zend OPcache" module assertion in php.bats passes. Also expect the 8.5 retry to resolve a transient docker.io manifest fetch error that hit graze/bats on the previous run. Co-Authored-By: Claude Opus 4.7 (1M context) --- 8.3/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/8.3/Dockerfile b/8.3/Dockerfile index ded59ab..1def43f 100644 --- a/8.3/Dockerfile +++ b/8.3/Dockerfile @@ -40,7 +40,8 @@ RUN set -xe \ sockets \ zip \ && yes '' | pecl install apcu event memcached yaml \ - && docker-php-ext-enable apcu memcached yaml sodium \ + # opcache ships as a shared module on 8.3 and isn't enabled by upstream + && docker-php-ext-enable apcu memcached yaml sodium opcache \ # event must load after sockets, hence the zz- prefix && docker-php-ext-enable --ini-name zz-docker-php-ext-event.ini event \ && apk del --no-network .build-deps \ From 6a0f376fa30346ea869a28158b2b1d4f8ae6e9e2 Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 15:58:51 +0100 Subject: [PATCH 12/15] Tighten bats container safe.directory, loosen iconv translit assertion - The bats container mounts the host workspace at /app, so the safe.directory entry only needs to cover /app rather than the catch-all '*'. Same outcome, scoped to the actual mount. - The TRANSLIT functional test was asserting an exact "caf'e" match, which is what gnu-libiconv 1.15-r3 produces. Newer gnu-libiconv (1.18+ used by the docker-library based 8.3-8.5 images) returns "cafe" with no apostrophe. Both prove TRANSLIT worked; assert on the absence of warnings, a "caf" prefix, and inequality with the original input instead of pinning a specific output. Co-Authored-By: Claude Opus 4.7 (1M context) --- Makefile | 2 +- common/php.bats | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9f0046b..b13a7a8 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ docker_bats := docker run --rm \ -e container \ -e GIT_CONFIG_COUNT=1 \ -e GIT_CONFIG_KEY_0=safe.directory \ - -e GIT_CONFIG_VALUE_0=* \ + -e GIT_CONFIG_VALUE_0=/app \ graze/bats build_args := --build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \ diff --git a/common/php.bats b/common/php.bats index 28d9b1a..4dbe730 100755 --- a/common/php.bats +++ b/common/php.bats @@ -94,9 +94,14 @@ echo "status: $status" echo "output: $output" [ "$status" -eq 0 ] - [ "$output" = "caf'e" ] + # gnu-libiconv's transliteration of 'é' varies across versions ("caf'e" + # in 1.15-r3, "cafe" in 1.18+). Both are valid; what we care about is + # that TRANSLIT didn't fall back to musl's iconv (which would warn and + # return the original byte sequence). [[ "${output}" != *"PHP Warning"* ]] [[ "${output}" != *"PHP Notice"* ]] + [[ "${output}" == caf* ]] + [ "${output}" != "café" ] } @test "the image has curl installed" { From ecf1249fc412fdada5416f066761dfa52c693b3b Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 16:14:18 +0100 Subject: [PATCH 13/15] Makefile: derive aggregate targets from a single VERSIONS list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace seven hand-edited "build-5.6 build-7.0 ... build-8.5"-style lines with $(addprefix …,$(VERSIONS)). Adding a future PHP version now means one edit (the VERSIONS line) instead of touching every aggregate target. Co-Authored-By: Claude Opus 4.7 (1M context) --- Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b13a7a8..54e178a 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ docker_bats := docker run --rm \ build_args := --build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \ --build-arg VCS_REF=$(shell git rev-parse --short HEAD) +VERSIONS := 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 + latest_5 := 5.6 latest_7 := 7.4 latest_8 := 8.5 @@ -33,25 +35,25 @@ latest := 8.5 .PHONY: prod-build prod-build-quick .DEFAULT: build -build: build-5.6 build-7.0 build-7.1 build-7.2 build-7.3 build-7.4 build-8.0 build-8.1 build-8.2 build-8.3 build-8.4 build-8.5 +build: $(addprefix build-,$(VERSIONS)) build-quick: make build cache="" pull="" build-quick-%: make build-$* cache="" pull="" -prod-build: prod-build-5.6 prod-build-7.0 prod-build-7.1 prod-build-7.2 prod-build-7.3 prod-build-7.4 prod-build-8.0 prod-build-8.1 prod-build-8.2 prod-build-8.3 prod-build-8.4 prod-build-8.5 +prod-build: $(addprefix prod-build-,$(VERSIONS)) prod-build-quick: make prod-build cache="" pull="" prod-build-quick-%: make prod-build-$* cache="" pull="" -tag: tag-5.6 tag-7.0 tag-7.1 tag-7.2 tag-7.3 tag-7.4 tag-8.0 tag-8.1 tag-8.2 tag-8.3 tag-8.4 tag-8.5 -test: test-5.6 test-7.0 test-7.1 test-7.2 test-7.3 test-7.4 test-8.0 test-8.1 test-8.2 test-8.3 test-8.4 test-8.5 -push: push-5.6 push-7.0 push-7.1 push-7.2 push-7.3 push-7.4 push-8.0 push-8.1 push-8.2 push-8.3 push-8.4 push-8.5 -clean: clean-5.6 clean-7.0 clean-7.1 clean-7.2 clean-7.3 clean-7.4 clean-8.0 clean-8.1 clean-8.2 clean-8.3 clean-8.4 clean-8.5 -deploy: deploy-5.6 deploy-7.0 deploy-7.1 deploy-7.2 deploy-7.3 deploy-7.4 deploy-8.0 deploy-8.1 deploy-8.2 deploy-8.3 deploy-8.4 deploy-8.5 +tag: $(addprefix tag-,$(VERSIONS)) +test: $(addprefix test-,$(VERSIONS)) +push: $(addprefix push-,$(VERSIONS)) +clean: $(addprefix clean-,$(VERSIONS)) +deploy: $(addprefix deploy-,$(VERSIONS)) build-%: cache ?= --no-cache build-%: pull ?= --pull From 6460767c9edd2701bdfa942e85db783d4931904c Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 16:16:25 +0100 Subject: [PATCH 14/15] Make versions.json the single source of truth for supported versions Add a versions.json at the repo root with one entry per supported PHP version, including the multi-arch platforms it ships to Docker Hub. The Makefile derives its VERSIONS list via jq, and the GitHub Actions workflow now has a tiny prep job that reads the file and emits the matrix include for the build job to consume. Adding a new version is now a one-line addition to versions.json; the Makefile and CI matrix update themselves. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build.yml | 37 ++++++++++++------------------------- Makefile | 2 +- versions.json | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 versions.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6f4c7a..203e32e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,37 +7,24 @@ on: branches: [master] jobs: + matrix: + name: Load matrix + runs-on: ubuntu-latest + outputs: + include: ${{ steps.load.outputs.include }} + steps: + - uses: actions/checkout@v6 + - id: load + run: echo "include=$(jq -c . versions.json)" >> "$GITHUB_OUTPUT" + build: name: PHP ${{ matrix.version }} + needs: matrix runs-on: ubuntu-latest strategy: fail-fast: false matrix: - include: - - version: "5.6" - platforms: "linux/amd64" - - version: "7.0" - platforms: "linux/amd64" - - version: "7.1" - platforms: "linux/amd64" - - version: "7.2" - platforms: "linux/amd64" - - version: "7.3" - platforms: "linux/amd64,linux/arm/v7,linux/arm64" - - version: "7.4" - platforms: "linux/amd64,linux/arm/v7,linux/arm64" - - version: "8.0" - platforms: "linux/amd64,linux/arm/v7,linux/arm64" - - version: "8.1" - platforms: "linux/amd64,linux/arm/v7,linux/arm64" - - version: "8.2" - platforms: "linux/amd64,linux/arm/v7,linux/arm64" - - version: "8.3" - platforms: "linux/amd64,linux/arm/v7,linux/arm64" - - version: "8.4" - platforms: "linux/amd64,linux/arm/v7,linux/arm64" - - version: "8.5" - platforms: "linux/amd64,linux/arm/v7,linux/arm64" + include: ${{ fromJson(needs.matrix.outputs.include) }} steps: - uses: actions/checkout@v6 diff --git a/Makefile b/Makefile index 54e178a..14092f7 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ docker_bats := docker run --rm \ build_args := --build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \ --build-arg VCS_REF=$(shell git rev-parse --short HEAD) -VERSIONS := 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 +VERSIONS := $(shell jq -r '.[].version' versions.json) latest_5 := 5.6 latest_7 := 7.4 diff --git a/versions.json b/versions.json new file mode 100644 index 0000000..17642f8 --- /dev/null +++ b/versions.json @@ -0,0 +1,14 @@ +[ + {"version": "5.6", "platforms": "linux/amd64"}, + {"version": "7.0", "platforms": "linux/amd64"}, + {"version": "7.1", "platforms": "linux/amd64"}, + {"version": "7.2", "platforms": "linux/amd64"}, + {"version": "7.3", "platforms": "linux/amd64,linux/arm/v7,linux/arm64"}, + {"version": "7.4", "platforms": "linux/amd64,linux/arm/v7,linux/arm64"}, + {"version": "8.0", "platforms": "linux/amd64,linux/arm/v7,linux/arm64"}, + {"version": "8.1", "platforms": "linux/amd64,linux/arm/v7,linux/arm64"}, + {"version": "8.2", "platforms": "linux/amd64,linux/arm/v7,linux/arm64"}, + {"version": "8.3", "platforms": "linux/amd64,linux/arm/v7,linux/arm64"}, + {"version": "8.4", "platforms": "linux/amd64,linux/arm/v7,linux/arm64"}, + {"version": "8.5", "platforms": "linux/amd64,linux/arm/v7,linux/arm64"} +] From bf486e866b60d290f5e781219a93c7a5d9943d66 Mon Sep 17 00:00:00 2001 From: Rick Lam Date: Thu, 28 May 2026 16:22:28 +0100 Subject: [PATCH 15/15] README: fix ev/event typo and outdated phpdbg example - The image installs the `event` PECL extension, not `ev`; correct the name and the linked PHP manual URL. - The `phpdbg7` example only worked when the :test tag pointed at a 7.x image. Since :test now resolves to 8.5 (built on docker-library php-cli-alpine), the binary is just `phpdbg`. Co-Authored-By: Claude Opus 4.7 (1M context) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 55bd312..bab3fdc 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Public image for php in alpine with a set of common extensions [apcu](http://php.net/manual/en/book.apcu.php) (PHP 7.0 +), [bcmath](http://php.net/manual/en/book.bc.php), Core, [ctype](http://php.net/manual/en/book.ctype.php), [curl](http://php.net/manual/en/book.curl.php), [date](http://php.net/manual/en/book.datetime.php), [dom](http://php.net/manual/en/book.dom.php), -[ev](http://php.net/manual/en/book.ev.php), [fileinfo](http://php.net/manual/en/book.fileinfo.php), +[event](http://php.net/manual/en/book.event.php), [fileinfo](http://php.net/manual/en/book.fileinfo.php), [filter](http://php.net/manual/en/book.filter.php), [hash](http://php.net/manual/en/book.hash.php), [iconv](http://php.net/manual/en/book.iconv.php) (with a [fix](https://github.com/docker-library/php/issues/240)), [intl](http://php.net/manual/en/book.intl.php), [json](http://php.net/manual/en/book.json.php), @@ -89,6 +89,6 @@ docker run --rm graze/php-alpine -v $(pwd):/srv php some/script.php ## Running with phpdbg ``` -docker run --rm graze/php-alpine:test -v $(pwd):/srv phpdbg7 some/script.php +docker run --rm graze/php-alpine:test -v $(pwd):/srv phpdbg some/script.php ```