diff --git a/.github/actions/track-patches/action.yml b/.github/actions/track-patches/action.yml new file mode 100644 index 0000000..df45791 --- /dev/null +++ b/.github/actions/track-patches/action.yml @@ -0,0 +1,16 @@ +name: Track deb.sury.org patches +description: > + For each EOL version in eol/, compares the Salsa commit pinned in its Dockerfiles' DEB_PATCHES + with the one deb.sury.org last built from, and opens or updates an issue when they differ. + +inputs: + token: + description: Token used to read and write the repository's issues. + default: ${{ github.token }} + distribution: + description: Debian release whose deb.sury.org source index is read. + default: trixie + +runs: + using: node24 + main: index.mjs diff --git a/.github/actions/track-patches/index.mjs b/.github/actions/track-patches/index.mjs new file mode 100644 index 0000000..3db608c --- /dev/null +++ b/.github/actions/track-patches/index.mjs @@ -0,0 +1,171 @@ +import { existsSync, readdirSync, readFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { gunzipSync } from 'node:zlib'; + +const SALSA = 'https://salsa.debian.org/php-team/php'; +const SALSA_API = 'https://salsa.debian.org/api/v4/projects/php-team%2Fphp'; + +const token = process.env['INPUT_TOKEN']; +const distribution = process.env['INPUT_DISTRIBUTION'] || 'trixie'; +const repository = process.env.GITHUB_REPOSITORY; +const githubApi = process.env.GITHUB_API_URL || 'https://api.github.com'; + +// Salsa sometimes answers with a 502, so server and network errors are retried. +async function download(url, attempts = 5) { + for (let attempt = 1; ; attempt++) { + const response = await fetch(url).catch((error) => ({ ok: false, status: 0, error })); + if (response.ok) { + return response; + } + const clientError = response.status >= 400 && response.status < 500; + if (clientError || attempt === attempts) { + throw new Error(`${url}: ${response.error?.message ?? `HTTP ${response.status}`}`); + } + await new Promise((resolve) => setTimeout(resolve, attempt * 3000)); + } +} + +async function github(method, path, body) { + const response = await fetch(`${githubApi}${path}`, { + method, + headers: { + accept: 'application/vnd.github+json', + authorization: `Bearer ${token}`, + 'content-type': 'application/json', + 'x-github-api-version': '2022-11-28', + }, + body: body && JSON.stringify(body), + }); + if (!response.ok) { + throw new Error(`GitHub API ${method} ${path}: HTTP ${response.status} ${await response.text()}`); + } + return response.json(); +} + +/** The EOL versions: every eol/ with a cli Dockerfile. */ +function eolVersions() { + return readdirSync('eol', { withFileTypes: true }) + .filter((entry) => entry.isDirectory() && existsSync(join('eol', entry.name, 'cli', 'Dockerfile'))) + .map((entry) => entry.name) + .sort(); +} + +/** The Salsa commit pinned in DEB_PATCHES, which every flavour of the version must agree on. */ +function pinnedCommit(version) { + const commits = new Set(); + for (const flavor of readdirSync(join('eol', version))) { + const dockerfile = join('eol', version, flavor, 'Dockerfile'); + const match = readFileSync(dockerfile, 'utf8').match(/DEB_PATCHES=\S*\/archive\/([0-9a-f]{40})\//); + if (!match) { + throw new Error(`${dockerfile} has no DEB_PATCHES commit`); + } + commits.add(match[1]); + } + if (commits.size !== 1) { + throw new Error(`the Dockerfiles pin different commits: ${[...commits].join(', ')}`); + } + return [...commits][0]; +} + +/** Package name → version, from deb.sury.org's index of source packages. */ +async function latestBuilds() { + const response = await download(`https://packages.sury.org/php/dists/${distribution}/main/source/Sources.gz`); + const index = gunzipSync(Buffer.from(await response.arrayBuffer())).toString('utf8'); + const builds = new Map(); + for (const stanza of index.split(/\n\s*\n/)) { + const name = stanza.match(/^Package: (\S+)$/m)?.[1]; + const version = stanza.match(/^Version: (\S+)$/m)?.[1]; + if (name && version && !builds.has(name)) { + builds.set(name, version); + } + } + return builds; +} + +/** + * Splits a build version such as "1:7.4.33-31+0~20261021.121+debian13~1.gbpe9c428" into its + * revision without epoch ("7.4.33-31") and the start of the Salsa commit it was built from + * ("e9c428"). + */ +function parseBuild(version) { + const match = version.match(/^(?:\d+:)?([^+]+)\+.*\.gbp([0-9a-f]+)$/); + return match && { revision: match[1], commitPrefix: match[2] }; +} + +async function fullCommit(prefix) { + const response = await download(`${SALSA_API}/repository/commits/${prefix}`); + return (await response.json()).id; +} + +async function seriesPatches(commit) { + const response = await download(`${SALSA}/-/raw/${commit}/debian/patches/series`); + return (await response.text()) + .split('\n') + .map((line) => line.trim().split(/\s+/)[0]) + .filter((name) => name && !name.startsWith('#')); +} + +async function openIssues() { + const issues = []; + for (let page = 1; ; page++) { + const batch = await github('GET', `/repos/${repository}/issues?state=open&per_page=100&page=${page}`); + issues.push(...batch.filter((issue) => !issue.pull_request)); + if (batch.length < 100) { + return issues; + } + } +} + +async function check(version, builds, issues) { + const pinned = pinnedCommit(version); + const build = builds.get(`php${version}`); + const parsed = build && parseBuild(build); + if (!parsed) { + throw new Error(`no php${version} build with a commit in the deb.sury.org index (got ${build ?? 'nothing'})`); + } + if (pinned.startsWith(parsed.commitPrefix)) { + console.log(`PHP ${version}: up to date (${build})`); + return; + } + + const latest = await fullCommit(parsed.commitPrefix); + const [before, after] = await Promise.all([seriesPatches(pinned), seriesPatches(latest)]); + const added = after.filter((name) => !before.includes(name)); + + const title = `PHP ${version} patches: new deb.sury.org build ${parsed.revision}`; + const body = [ + `deb.sury.org published \`${build}\`, built from Salsa commit [\`${latest.slice(0, 12)}\`](${SALSA}/-/commit/${latest}). Our Dockerfiles pin [\`${pinned.slice(0, 12)}\`](${SALSA}/-/commit/${pinned}).`, + '', + `Changes: ${SALSA}/-/compare/${pinned}...${latest}`, + '', + 'Patches added to its series:', + ...(added.length ? added.map((name) => `- \`${name}\``) : ['None.']), + '', + `To update, set the new commit in \`DEB_PATCHES\` and the revision in \`PHP_PATCHES\` in every \`eol/${version}/*/Dockerfile\`, and review each new patch into \`eol/patches/series.${version}\`, applied or commented out.`, + ].join('\n'); + + const existing = issues.find((issue) => issue.title.startsWith(`PHP ${version} patches:`)); + if (existing) { + await github('PATCH', `/repos/${repository}/issues/${existing.number}`, { title, body }); + console.log(`PHP ${version}: updated issue #${existing.number} (${build})`); + } else { + const issue = await github('POST', `/repos/${repository}/issues`, { title, body }); + console.log(`PHP ${version}: opened issue #${issue.number} (${build})`); + } +} + +try { + const builds = await latestBuilds(); + const issues = await openIssues(); + for (const version of eolVersions()) { + try { + await check(version, builds, issues); + } catch (error) { + console.log(`::error::PHP ${version}: ${error.message}`); + process.exitCode = 1; + } + } +} catch (error) { + console.log(`::error::${error.message}`); + process.exitCode = 1; +} diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 797f5a4..1fbda65 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -65,20 +65,24 @@ jobs: flavorDir="${FLAVOR#-}" eolDir="eol/$VERSION/${flavorDir:-cli}" [[ -d "$eolDir" ]] && eol=true || eol=false + [[ "$eol" == true ]] && debPatches="$(sed -n 's/^ARG DEB_PATCHES=//p' "$eolDir/Dockerfile")" || debPatches= [[ "$tag" == *alpine* ]] && dockerfile=Dockerfile.alpine || dockerfile=Dockerfile [[ "$VERSION" == '5.6' && "$ARCH" == 'arm64' ]] && dev=false || dev=true [[ "$VERSION" == '5.6' || "$VERSION" == '7.0' ]] && pcov=false || pcov=true [[ "$ARCH" == 'amd64' ]] && xhprof=true || xhprof=false [[ "$VERSION" == 8.* || "$VERSION" == 'latest' || "$VERSION" == 'alpine' ]] && otel=true || otel=false + [[ "$VERSION" == '5.6' ]] && compat=true || compat=false { echo "tag=$tag" echo "eol=$eol" echo "eol-dir=$eolDir" + echo "deb-patches=$debPatches" echo "dockerfile=$dockerfile" echo "dev=$dev" echo "pcov=$pcov" echo "xhprof=$xhprof" echo "otel=$otel" + echo "compat=$compat" } >> "$GITHUB_OUTPUT" - name: Set up Docker Buildx @@ -99,6 +103,32 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Restore deb.sury.org's patches + id: deb-patches + if: ${{ steps.plan.outputs.eol == 'true' }} + uses: actions/cache@v6 + with: + path: ${{ runner.temp }}/deb-patches + key: deb-patches-${{ steps.plan.outputs.deb-patches }} + + - name: Download deb.sury.org's patches + if: ${{ steps.plan.outputs.eol == 'true' && steps.deb-patches.outputs.cache-hit != 'true' }} + env: + URL: ${{ steps.plan.outputs.deb-patches }} + run: | + archive="$RUNNER_TEMP/deb-patches.tar.gz" + dir="$RUNNER_TEMP/deb-patches" + for attempt in 1 2 3 4 5; do + rm -rf "$dir" + mkdir "$dir" + if curl -fsSL --retry 3 -o "$archive" "$URL" && tar -xzf "$archive" -C "$dir"; then + exit 0 + fi + echo "::warning::Attempt $attempt to download $URL failed" + sleep $((attempt * 15)) + done + exit 1 + - name: Build patched PHP base image id: base if: ${{ steps.plan.outputs.eol == 'true' }} @@ -110,7 +140,7 @@ jobs: context: ${{ steps.plan.outputs.eol-dir }} build-contexts: | patches=eol/patches - scripts=eol/scripts + deb-patches=${{ runner.temp }}/deb-patches push: ${{ env.PUSH }} cache-write: ${{ env.CACHE_WRITE }} @@ -185,6 +215,20 @@ jobs: no-cache: ${{ env.NO_CACHE }} test: otel + - name: Build compat image + if: ${{ steps.plan.outputs.compat == 'true' }} + uses: ./.github/actions/build-image + with: + image: php-compat + tag: ${{ steps.plan.outputs.tag }} + arch: ${{ matrix.arch }} + context: ./compat + build-args: BASE_IMAGE=${{ steps.php.outputs.ref }} + push: ${{ env.PUSH }} + cache-write: ${{ env.CACHE_WRITE }} + no-cache: ${{ env.NO_CACHE }} + test: compat + - name: Upload digests if: ${{ env.PUSH == 'ghcr' }} uses: actions/upload-artifact@v7 diff --git a/.github/workflows/publish.compat.yml b/.github/workflows/publish.compat.yml deleted file mode 100644 index ffe5b37..0000000 --- a/.github/workflows/publish.compat.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Publish compatibility images - -on: - workflow_run: - workflows: ["Test compatibility images"] - branches: [main] - types: [completed] - -# Every completed test run starts this workflow; runs that won't publish get their own group, so -# they can't cancel a publish in progress. -concurrency: - group: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request' && github.event.workflow_run.head_sha == github.sha && github.workflow || github.run_id }} - cancel-in-progress: true - -jobs: - publish-compat: - name: Build and publish compatibility images - runs-on: ubuntu-22.04 - if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request' && github.event.workflow_run.head_sha == github.sha }} - strategy: - fail-fast: false - matrix: - version: [ '5.6' ] - flavor: [ '', '-apache', '-fpm' ] - steps: - - name: Checkout - uses: actions/checkout@v7 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 - with: - driver-opts: network=host - - - name: Login to DockerHub (pull) - uses: docker/login-action@v4 - with: - username: ${{ secrets.DOCKER_PULL_USER_4 }} - password: ${{ secrets.DOCKER_PULL_PASS_4 }} - - - name: Pull base image - run: docker pull debian:stretch-slim - - - name: Login to DockerHub (push) - uses: docker/login-action@v4 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build image and push to registry - uses: docker/build-push-action@v7 - with: - platforms: linux/amd64,linux/arm64 -# cache-from: type=registry,ref=ghcr.io/chialab/php-compat:${{ matrix.version }}${{ matrix.flavor }} - cache-to: type=inline - context: ./compat - build-contexts: patches=eol/patches - file: ${{ format('compat/{0}.{1}{2}', 'Dockerfile', matrix.version, matrix.flavor) }} - tags: | - chialab/php-compat:${{ matrix.version }}${{ matrix.flavor }} - ghcr.io/chialab/php-compat:${{ matrix.version }}${{ matrix.flavor }} - push: true diff --git a/.github/workflows/test.compat.yml b/.github/workflows/test.compat.yml deleted file mode 100644 index 8e52382..0000000 --- a/.github/workflows/test.compat.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Test compatibility images - -on: - schedule: - # chosen by fair dice roll - - cron: '42 18 * * 2' - push: - branches: [main] - pull_request: - types: [opened, synchronize] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test-compat: - name: Build and test compatibility images - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - version: [ '5.6' ] - flavor: [ '', '-apache', '-fpm' ] - services: - registry: - image: registry:2 - ports: - - 5000:5000 - steps: - - name: Checkout - uses: actions/checkout@v7 - - - name: Login to DockerHub - uses: docker/login-action@v4 - with: - username: ${{ secrets.DOCKER_PULL_USER_4 }} - password: ${{ secrets.DOCKER_PULL_PASS_4 }} - - - name: Build image for testing - uses: docker/build-push-action@v7 - with: -# cache-from: type=registry,ref=ghcr.io/chialab/php-compat:${{ matrix.version }}${{ matrix.flavor }} - cache-to: type=inline - context: ./compat - build-contexts: patches=eol/patches - file: ${{ format('compat/{0}.{1}{2}', 'Dockerfile', matrix.version, matrix.flavor) }} - tags: localhost:5000/chialab/php-compat:${{ matrix.version }}${{ matrix.flavor }} - push: true - - - name: Test image - env: - REGISTRY: localhost:5000/ - VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: 'docker pull localhost:5000/chialab/php-compat:${{ matrix.version }}${{ matrix.flavor }} && make -C compat test' diff --git a/.github/workflows/track-patches.yml b/.github/workflows/track-patches.yml new file mode 100644 index 0000000..fa8922e --- /dev/null +++ b/.github/workflows/track-patches.yml @@ -0,0 +1,23 @@ +name: Track deb.sury.org patches + +# Opens an issue when deb.sury.org publishes a build of an EOL version from a newer Salsa commit +# than the one pinned in its Dockerfiles' DEB_PATCHES. + +on: + schedule: + - cron: '17 6 * * 1' + workflow_dispatch: + +jobs: + track: + name: Compare pinned commits with deb.sury.org builds + runs-on: ubuntu-24.04 + permissions: + contents: read + issues: write + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Check each EOL version + uses: ./.github/actions/track-patches diff --git a/Makefile b/Makefile index e0018cc..7dbcbfc 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ build-base: exit 1; \ fi @echo " =====> Building $(BASE_IMAGE)..." - docker image build --quiet --build-context patches=eol/patches --build-context scripts=eol/scripts -t $(BASE_IMAGE) $(EOL_DIR) + docker image build --quiet --build-context patches=eol/patches -t $(BASE_IMAGE) $(EOL_DIR) test: @echo -e "=====> Testing loaded extensions... \c" diff --git a/README.md b/README.md index 188a166..8df2174 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ # Docker PHP images -[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/main.yml?branch=main&style=flat-square)](https://github.com/chialab/docker-php/actions) +[![PHP 5 build](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/test.5.yml?branch=main&label=PHP%205&style=flat-square)](https://github.com/chialab/docker-php/actions/workflows/test.5.yml?query=branch%3Amain) +[![PHP 7 build](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/test.7.yml?branch=main&label=PHP%207&style=flat-square)](https://github.com/chialab/docker-php/actions/workflows/test.7.yml?query=branch%3Amain) +[![PHP 8 build](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/test.8.yml?branch=main&label=PHP%208&style=flat-square)](https://github.com/chialab/docker-php/actions/workflows/test.8.yml?query=branch%3Amain) +[![latest build](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/test.latest.yml?branch=main&label=latest&style=flat-square)](https://github.com/chialab/docker-php/actions/workflows/test.latest.yml?query=branch%3Amain) [![Source link](https://img.shields.io/badge/Source-GitHub-lightgrey.svg?style=flat-square)](https://github.com/chialab/docker-php) [![Authors link](https://img.shields.io/badge/Authors-Chialab-lightgrey.svg?style=flat-square)](https://www.chialab.it) [![Docker Pulls](https://img.shields.io/docker/pulls/chialab/php.svg?style=flat-square)](https://hub.docker.com/r/chialab/php/) -[![License](https://img.shields.io/github/license/chialab/docker-php.svg?style=flat-square)](https://github.com/chialab/docker-php/blob/master/LICENSE) +[![License](https://img.shields.io/github/license/chialab/docker-php.svg?style=flat-square)](https://github.com/chialab/docker-php/blob/main/LICENSE) Docker images built on top of the [official PHP images](https://hub.docker.com/r/_/php/) with the addition of some common and useful extensions, installed with [mlocati/docker-php-extension-installer](https://github.com/mlocati/docker-php-extension-installer). You can find these images on the [Docker Hub](https://hub.docker.com/r/chialab/php/) (and if you're reading this file, you're probably already there). @@ -14,53 +17,29 @@ For development environments, you might want to choose an [image with XDebug ins If you use Open Telemetry in your project, you may be interested in an [image with the OTel PHP extension](https://hub.docker.com/r/chialab/php-otel/). -If you are really desperate and need PHP 5.6 with support for MySQL 8.x, check the [php-compat](https://hub.docker.com/r/chialab/php-compat/) image. +If you need PHP 5.6 to connect to a MySQL 8.x server that keeps `caching_sha2_password` as its default authentication plugin, check the [php-compat](https://hub.docker.com/r/chialab/php-compat/) image. ## Available tags -- `latest` -- `5.6` -- `5.6-apache` -- `5.6-fpm` -- `7.0` -- `7.0-apache` -- `7.0-fpm` -- `7.1` -- `7.1-apache` -- `7.1-fpm` -- `7.2` -- `7.2-apache` -- `7.2-fpm` -- `7.3` -- `7.3-apache` -- `7.3-fpm` -- `7.4` -- `7.4-apache` -- `7.4-fpm` -- `8.0` -- `8.0-apache` -- `8.0-fpm` -- `8.1` -- `8.1-apache` -- `8.1-fpm` -- `8.2` -- `8.2-apache` -- `8.2-fpm` -- `8.3` -- `8.3-apache` -- `8.3-fpm` -- `8.4` -- `8.4-apache` -- `8.4-fpm` -- `8.5` -- `8.5-apache` -- `8.5-fpm` +- `latest`, `alpine` +- `8.5`, `8.5-apache`, `8.5-fpm`, `8.5-alpine`, `8.5-fpm-alpine` +- `8.4`, `8.4-apache`, `8.4-fpm`, `8.4-alpine`, `8.4-fpm-alpine` +- `8.3`, `8.3-apache`, `8.3-fpm`, `8.3-alpine`, `8.3-fpm-alpine` +- `8.2`, `8.2-apache`, `8.2-fpm`, `8.2-alpine`, `8.2-fpm-alpine` +- `8.1`, `8.1-apache`, `8.1-fpm`, `8.1-alpine`, `8.1-fpm-alpine` +- `8.0`, `8.0-apache`, `8.0-fpm`, `8.0-alpine`, `8.0-fpm-alpine` +- `7.4`, `7.4-apache`, `7.4-fpm`, `7.4-alpine`, `7.4-fpm-alpine` +- `7.3`, `7.3-apache`, `7.3-fpm`, `7.3-alpine`, `7.3-fpm-alpine` +- `7.2`, `7.2-apache`, `7.2-fpm`, `7.2-alpine`, `7.2-fpm-alpine` +- `7.1`, `7.1-apache`, `7.1-fpm`, `7.1-alpine`, `7.1-fpm-alpine` +- `7.0`, `7.0-apache`, `7.0-fpm` +- `5.6`, `5.6-apache`, `5.6-fpm` As you might have guessed, all tags are built on top of the corresponding tag of the official image. Not all tags are supported in order to easen maintenance. ### Security backports for EOL versions The official images of unsupported PHP versions (5.6 to 8.1) no longer receive security fixes. For those versions we rebuild PHP from the official images' Dockerfiles (see [`eol/`](eol/)), on the same OS release, with security patches applied to the PHP sources. The image layout doesn't change, so `docker-php-ext-*` and `install-php-extensions` keep working. -The `PHP_PATCHES` environment variable and the `it.chialab.php.patches` label list what has been applied. `PHP_VERSION` and `php -v` still report the upstream version, so vulnerability scanners may keep flagging fixed issues. +The patches are the security and bug-fix backports maintained for [deb.sury.org](https://deb.sury.org), taken from the Debian PHP team's [packaging repository](https://salsa.debian.org/php-team/php). Debian packaging changes, changed defaults and deb.sury.org's version-check telemetry are left out. The `PHP_PATCHES` environment variable and the `it.chialab.php.patches` label name the deb.sury.org build the patches come from (e.g. `deb.sury.org-7.4.33-31`). `PHP_VERSION` and `php -v` still report the upstream version, so vulnerability scanners may keep flagging fixed issues. ## Installed extensions The following modules and extensions have been enabled, @@ -109,4 +88,4 @@ Pull requests are welcome, too! 😁 Please, run `make build` and `make test` be ## License -Docker PHP Images is released under the [MIT](https://github.com/chialab/docker-php/blob/master/LICENSE) license. +Docker PHP Images is released under the [MIT](https://github.com/chialab/docker-php/blob/main/LICENSE) license. diff --git a/compat/Dockerfile b/compat/Dockerfile new file mode 100644 index 0000000..f6dab86 --- /dev/null +++ b/compat/Dockerfile @@ -0,0 +1,16 @@ +ARG BASE_IMAGE=chialab/php:5.6 +FROM ${BASE_IMAGE} +LABEL maintainer="dev@chialab.io" + +# Rebuild the MySQL extensions against MariaDB's libmysqlclient instead of mysqlnd: it can connect +# to MySQL 8+ servers whose default authentication plugin (caching_sha2_password) mysqlnd 5.6 +# doesn't know, as long as the account itself uses mysql_native_password. +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends libmariadbclient-dev-compat; \ + rm -rf /var/lib/apt/lists/*; \ + rm -f "$PHP_INI_DIR"/conf.d/docker-php-ext-mysql.ini "$PHP_INI_DIR"/conf.d/docker-php-ext-mysqli.ini "$PHP_INI_DIR"/conf.d/docker-php-ext-pdo_mysql.ini; \ + docker-php-ext-configure mysql --with-mysql=/usr --with-libdir="lib/$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure mysqli --with-mysqli=/usr/bin/mysql_config; \ + docker-php-ext-configure pdo_mysql --with-pdo-mysql=/usr; \ + docker-php-ext-install mysql mysqli pdo_mysql diff --git a/compat/Dockerfile.5.6 b/compat/Dockerfile.5.6 deleted file mode 100644 index b00390b..0000000 --- a/compat/Dockerfile.5.6 +++ /dev/null @@ -1,272 +0,0 @@ -# -# This is taken from the official PHP image's Dockerfile (https://github.com/docker-library/php/tree/783878384a8f3953ed571e5a34ba0fe546726c85) -# and slightly fixed to work in this day and age. -# - -FROM debian:stretch-slim - -LABEL maintainer="dev@chialab.io" - -# Fix Debian 9 (Stretch) source list, because it has been moved to archive, and update packages. -RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \ - -e 's/security.debian.org/archive.debian.org/g' \ - -e '/stretch-updates/d' /etc/apt/sources.list \ - && apt-get update && apt-get upgrade -y - -# prevent Debian's PHP packages from being installed -# https://github.com/docker-library/php/pull/542 -RUN set -eux; \ - { \ - echo 'Package: php*'; \ - echo 'Pin: release *'; \ - echo 'Pin-Priority: -1'; \ - } > /etc/apt/preferences.d/no-debian-php - -# dependencies required for running "phpize" -# (see persistent deps below) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkg-config \ - re2c - -# persistent / runtime deps -RUN apt-get update && apt-get install -y \ - $PHPIZE_DEPS \ - ca-certificates \ - curl \ - xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* - -ENV PHP_INI_DIR /usr/local/etc/php -RUN mkdir -p $PHP_INI_DIR/conf.d - -#### -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 - -ENV PHP_VERSION 5.6.40 -ENV PHP_URL="https://www.php.net/distributions/php-5.6.40.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-5.6.40.tar.xz.asc" -ENV PHP_SHA256="1369a51eee3995d7fbd1c5342e5cc917760e276d561595b6052b21ace2656d1c" PHP_MD5="" - -RUN set -xe; \ - \ - fetchDeps=' \ - wget \ - '; \ - if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ - dirmngr \ - gnupg \ - "; \ - fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - wget -O php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps - -COPY --from=php:5.6 /usr/local/bin/docker-php-source /usr/local/bin/ - -# Security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=5.6,target=/usr/src/php-patches \ - --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libedit-dev \ - libsqlite3-dev \ - libssl1.0-dev \ - libxml2-dev \ - zlib1g-dev \ - libmariadb2 libmariadbclient-dev-compat \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# Use MariaDB's libmysqlclient library instead of mysqlnd to be able to communicate with MySQL 8+, which uses new locales of the utf8mb4 family that are unknown to old mysqlnd - --disable-mysqlnd \ - --with-mysql="/usr" \ - --with-mysqli="/usr/bin/mysql_config" \ - --with-pdo-mysql="/usr" \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ - php --version; \ - \ -# https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc - -COPY --from=php:5.6 /usr/local/bin/docker-php-ext-* /usr/local/bin/docker-php-entrypoint /usr/local/bin/ - -ENTRYPOINT ["docker-php-entrypoint"] -#### -CMD ["php", "-a"] -#### - -# Download script to install PHP extensions and dependencies -ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ - -RUN chmod +x /usr/local/bin/install-php-extensions - -# PEAR < 1.10.18 can't read pecl.php.net responses anymore. -RUN pear upgrade --force https://pear.php.net/get/PEAR-1.10.18.tgz - -# retry: PECL sometimes replies "No releases available" on CI runners. -RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ - DEBIAN_FRONTEND=noninteractive apt-get update -q \ - && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y \ - curl \ - git \ - zip unzip \ -# iconv, mbstring and pdo_sqlite are omitted as they are already installed - && PHP_EXTENSIONS=" \ - amqp \ - bcmath \ - bz2 \ - calendar \ - event \ - exif \ - gd \ - gettext \ - imagick \ - intl \ - ldap \ - mcrypt \ - memcached \ - mysql \ - mysqli \ - opcache \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - redis \ - soap \ - sockets \ - xsl \ - zip \ - " \ - && retry install-php-extensions $PHP_EXTENSIONS - -# Install Composer. -ENV PATH=$PATH:/root/composer/vendor/bin \ - COMPOSER_ALLOW_SUPERUSER=1 \ - COMPOSER_HOME=/root/composer -RUN cd /opt \ - # Download installer and check for its integrity. - && curl -sSL https://getcomposer.org/installer > composer-setup.php \ - && curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \ - && sha384sum --check composer-setup.sha384sum \ - # Install Composer 2. - && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --2 \ - # Remove installer files. - && rm /opt/composer-setup.php /opt/composer-setup.sha384sum diff --git a/compat/Dockerfile.5.6-apache b/compat/Dockerfile.5.6-apache deleted file mode 100644 index 5aaa4d6..0000000 --- a/compat/Dockerfile.5.6-apache +++ /dev/null @@ -1,337 +0,0 @@ -# -# This is taken from the official PHP image's Dockerfile (https://github.com/docker-library/php/tree/783878384a8f3953ed571e5a34ba0fe546726c85) -# and slightly fixed to work in this day and age. -# - -FROM debian:stretch-slim - -LABEL maintainer="dev@chialab.io" - -# Fix Debian 9 (Stretch) source list, because it has been moved to archive, and update packages. -RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \ - -e 's/security.debian.org/archive.debian.org/g' \ - -e '/stretch-updates/d' /etc/apt/sources.list \ - && apt-get update && apt-get upgrade -y - -# prevent Debian's PHP packages from being installed -# https://github.com/docker-library/php/pull/542 -RUN set -eux; \ - { \ - echo 'Package: php*'; \ - echo 'Pin: release *'; \ - echo 'Pin-Priority: -1'; \ - } > /etc/apt/preferences.d/no-debian-php - -# dependencies required for running "phpize" -# (see persistent deps below) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkg-config \ - re2c - -# persistent / runtime deps -RUN apt-get update && apt-get install -y \ - $PHPIZE_DEPS \ - ca-certificates \ - curl \ - xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* - -ENV PHP_INI_DIR /usr/local/etc/php -RUN mkdir -p $PHP_INI_DIR/conf.d - -#### -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - apache2 \ - && rm -rf /var/lib/apt/lists/* - -ENV APACHE_CONFDIR /etc/apache2 -ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars - -RUN set -eux; \ - \ -# generically convert lines like -# export APACHE_RUN_USER=www-data -# into -# : ${APACHE_RUN_USER:=www-data} -# export APACHE_RUN_USER -# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ - \ -# setup directories and permissions - . "$APACHE_ENVVARS"; \ - for dir in \ - "$APACHE_LOCK_DIR" \ - "$APACHE_RUN_DIR" \ - "$APACHE_LOG_DIR" \ - /var/www/html \ - ; do \ - rm -rvf "$dir"; \ - mkdir -p "$dir"; \ - chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - chmod 777 "$dir"; \ - done; \ - \ -# logs should go to stdout / stderr - ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \ - chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR" - -# Apache + PHP requires preforking Apache for best results -RUN a2dismod mpm_event && a2enmod mpm_prefork - -# PHP files should be handled by PHP, and should be preferred over any other file type -RUN { \ - echo ''; \ - echo '\tSetHandler application/x-httpd-php'; \ - echo ''; \ - echo; \ - echo 'DirectoryIndex disabled'; \ - echo 'DirectoryIndex index.php index.html'; \ - echo; \ - echo ''; \ - echo '\tOptions -Indexes'; \ - echo '\tAllowOverride All'; \ - echo ''; \ - } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \ - && a2enconf docker-php - -ENV PHP_EXTRA_BUILD_DEPS apache2-dev -ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2 --disable-cgi -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 - -ENV PHP_VERSION 5.6.40 -ENV PHP_URL="https://www.php.net/distributions/php-5.6.40.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-5.6.40.tar.xz.asc" -ENV PHP_SHA256="1369a51eee3995d7fbd1c5342e5cc917760e276d561595b6052b21ace2656d1c" PHP_MD5="" - -RUN set -xe; \ - \ - fetchDeps=' \ - wget \ - '; \ - if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ - dirmngr \ - gnupg \ - "; \ - fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - wget -O php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps - -COPY --from=php:5.6-apache /usr/local/bin/docker-php-source /usr/local/bin/ - -# Security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=5.6,target=/usr/src/php-patches \ - --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libedit-dev \ - libsqlite3-dev \ - libssl1.0-dev \ - libxml2-dev \ - zlib1g-dev \ - libmariadb2 libmariadbclient-dev-compat \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# Use MariaDB's libmysqlclient library instead of mysqlnd to be able to communicate with MySQL 8+, which uses new locales of the utf8mb4 family that are unknown to old mysqlnd - --disable-mysqlnd \ - --with-mysql="/usr" \ - --with-mysqli="/usr/bin/mysql_config" \ - --with-pdo-mysql="/usr" \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ - php --version; \ - \ -# https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc - -COPY --from=php:5.6-apache /usr/local/bin/docker-php-ext-* /usr/local/bin/docker-php-entrypoint /usr/local/bin/ - -ENTRYPOINT ["docker-php-entrypoint"] -#### -COPY --from=php:5.6-apache /usr/local/bin/apache2-foreground /usr/local/bin/ -WORKDIR /var/www/html - -EXPOSE 80 -CMD ["apache2-foreground"] -#### - -# Download script to install PHP extensions and dependencies -ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ - -RUN chmod +x /usr/local/bin/install-php-extensions - -# PEAR < 1.10.18 can't read pecl.php.net responses anymore. -RUN pear upgrade --force https://pear.php.net/get/PEAR-1.10.18.tgz - -# retry: PECL sometimes replies "No releases available" on CI runners. -RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ - DEBIAN_FRONTEND=noninteractive apt-get update -q \ - && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y \ - curl \ - git \ - zip unzip \ -# iconv, mbstring and pdo_sqlite are omitted as they are already installed - && PHP_EXTENSIONS=" \ - amqp \ - bcmath \ - bz2 \ - calendar \ - event \ - exif \ - gd \ - gettext \ - imagick \ - intl \ - ldap \ - mcrypt \ - memcached \ - mysql \ - mysqli \ - opcache \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - redis \ - soap \ - sockets \ - xsl \ - zip \ - " \ - && retry install-php-extensions $PHP_EXTENSIONS \ - && if command -v a2enmod; then a2enmod rewrite; fi - -# Install Composer. -ENV PATH=$PATH:/root/composer/vendor/bin \ - COMPOSER_ALLOW_SUPERUSER=1 \ - COMPOSER_HOME=/root/composer -RUN cd /opt \ - # Download installer and check for its integrity. - && curl -sSL https://getcomposer.org/installer > composer-setup.php \ - && curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \ - && sha384sum --check composer-setup.sha384sum \ - # Install Composer 2. - && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --2 \ - # Remove installer files. - && rm /opt/composer-setup.php /opt/composer-setup.sha384sum diff --git a/compat/Dockerfile.5.6-fpm b/compat/Dockerfile.5.6-fpm deleted file mode 100644 index dbc6e41..0000000 --- a/compat/Dockerfile.5.6-fpm +++ /dev/null @@ -1,312 +0,0 @@ -# -# This is taken from the official PHP image's Dockerfile (https://github.com/docker-library/php/tree/783878384a8f3953ed571e5a34ba0fe546726c85) -# and slightly fixed to work in this day and age. -# - -FROM debian:stretch-slim - -LABEL maintainer="dev@chialab.io" - -# Fix Debian 9 (Stretch) source list, because it has been moved to archive, and update packages. -RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \ - -e 's/security.debian.org/archive.debian.org/g' \ - -e '/stretch-updates/d' /etc/apt/sources.list \ - && apt-get update && apt-get upgrade -y - -# prevent Debian's PHP packages from being installed -# https://github.com/docker-library/php/pull/542 -RUN set -eux; \ - { \ - echo 'Package: php*'; \ - echo 'Pin: release *'; \ - echo 'Pin-Priority: -1'; \ - } > /etc/apt/preferences.d/no-debian-php - -# dependencies required for running "phpize" -# (see persistent deps below) -ENV PHPIZE_DEPS \ - autoconf \ - dpkg-dev \ - file \ - g++ \ - gcc \ - libc-dev \ - make \ - pkg-config \ - re2c - -# persistent / runtime deps -RUN apt-get update && apt-get install -y \ - $PHPIZE_DEPS \ - ca-certificates \ - curl \ - xz-utils \ - --no-install-recommends && rm -r /var/lib/apt/lists/* - -ENV PHP_INI_DIR /usr/local/etc/php -RUN mkdir -p $PHP_INI_DIR/conf.d - -#### -ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi -#### - -# Apply stack smash protection to functions using local buffers and alloca() -# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64) -# Enable optimization (-O2) -# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default) -# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated) -# https://github.com/docker-library/php/issues/272 -ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2" -ENV PHP_CPPFLAGS="$PHP_CFLAGS" -ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" - -ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3 - -ENV PHP_VERSION 5.6.40 -ENV PHP_URL="https://www.php.net/distributions/php-5.6.40.tar.xz" PHP_ASC_URL="https://www.php.net/distributions/php-5.6.40.tar.xz.asc" -ENV PHP_SHA256="1369a51eee3995d7fbd1c5342e5cc917760e276d561595b6052b21ace2656d1c" PHP_MD5="" - -RUN set -xe; \ - \ - fetchDeps=' \ - wget \ - '; \ - if ! command -v gpg > /dev/null; then \ - fetchDeps="$fetchDeps \ - dirmngr \ - gnupg \ - "; \ - fi; \ - apt-get update; \ - apt-get install -y --no-install-recommends $fetchDeps; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mkdir -p /usr/src; \ - cd /usr/src; \ - \ - wget -O php.tar.xz "$PHP_URL"; \ - \ - if [ -n "$PHP_SHA256" ]; then \ - echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \ - fi; \ - if [ -n "$PHP_MD5" ]; then \ - echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \ - fi; \ - \ - if [ -n "$PHP_ASC_URL" ]; then \ - wget -O php.tar.xz.asc "$PHP_ASC_URL"; \ - export GNUPGHOME="$(mktemp -d)"; \ - for key in $GPG_KEYS; do \ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \ - done; \ - gpg --batch --verify php.tar.xz.asc php.tar.xz; \ - command -v gpgconf > /dev/null && gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - fi; \ - \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps - -COPY --from=php:5.6-fpm /usr/local/bin/docker-php-source /usr/local/bin/ - -# Security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=5.6,target=/usr/src/php-patches \ - --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches - -RUN set -eux; \ - \ - savedAptMark="$(apt-mark showmanual)"; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libcurl4-openssl-dev \ - libedit-dev \ - libsqlite3-dev \ - libssl1.0-dev \ - libxml2-dev \ - zlib1g-dev \ - libmariadb2 libmariadbclient-dev-compat \ - ${PHP_EXTRA_BUILD_DEPS:-} \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - export \ - CFLAGS="$PHP_CFLAGS" \ - CPPFLAGS="$PHP_CPPFLAGS" \ - LDFLAGS="$PHP_LDFLAGS" \ - ; \ - docker-php-source extract; \ - cd /usr/src/php; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ -# https://bugs.php.net/bug.php?id=74125 - if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi; \ - ./configure \ - --build="$gnuArch" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - \ -# make sure invalid --configure-flags are fatal errors intead of just warnings - --enable-option-checking=fatal \ - \ -# https://github.com/docker-library/php/issues/439 - --with-mhash \ - \ -# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236) - --enable-ftp \ -# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195) - --enable-mbstring \ -# Use MariaDB's libmysqlclient library instead of mysqlnd to be able to communicate with MySQL 8+, which uses new locales of the utf8mb4 family that are unknown to old mysqlnd - --disable-mysqlnd \ - --with-mysql="/usr" \ - --with-mysqli="/usr/bin/mysql_config" \ - --with-pdo-mysql="/usr" \ - \ - --with-curl \ - --with-libedit \ - --with-openssl \ - --with-zlib \ - \ -# bundled pcre does not support JIT on s390x -# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT - $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \ - --with-libdir="lib/$debMultiarch" \ - \ - ${PHP_EXTRA_CONFIGURE_ARGS:-} \ - ; \ - make -j "$(nproc)"; \ - make install; \ - find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; \ - make clean; \ - \ -# https://github.com/docker-library/php/issues/692 (copy default example "php.ini" files somewhere easily discoverable) - cp -v php.ini-* "$PHP_INI_DIR/"; \ - \ - cd /; \ - docker-php-source delete; \ - \ -# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies - apt-mark auto '.*' > /dev/null; \ - [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ - find /usr/local -type f -executable -exec ldd '{}' ';' \ - | awk '/=>/ { print $(NF-1) }' \ - | sort -u \ - | xargs -r dpkg-query --search \ - | cut -d: -f1 \ - | sort -u \ - | xargs -r apt-mark manual \ - ; \ - apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ - \ - php --version; \ - \ -# https://github.com/docker-library/php/issues/443 - pecl update-channels; \ - rm -rf /tmp/pear ~/.pearrc - -COPY --from=php:5.6-fpm /usr/local/bin/docker-php-ext-* /usr/local/bin/docker-php-entrypoint /usr/local/bin/ - -ENTRYPOINT ["docker-php-entrypoint"] -#### -WORKDIR /var/www/html - -RUN set -ex \ - && cd /usr/local/etc \ - && if [ -d php-fpm.d ]; then \ - # for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf" - sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \ - cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \ - else \ - # PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency - mkdir php-fpm.d; \ - cp php-fpm.conf.default php-fpm.d/www.conf; \ - { \ - echo '[global]'; \ - echo 'include=etc/php-fpm.d/*.conf'; \ - } | tee php-fpm.conf; \ - fi \ - && { \ - echo '[global]'; \ - echo 'error_log = /proc/self/fd/2'; \ - echo; \ - echo '[www]'; \ - echo '; if we send this to /proc/self/fd/1, it never appears'; \ - echo 'access.log = /proc/self/fd/2'; \ - echo; \ - echo 'clear_env = no'; \ - echo; \ - echo '; Ensure worker stdout and stderr are sent to the main error log.'; \ - echo 'catch_workers_output = yes'; \ - } | tee php-fpm.d/docker.conf \ - && { \ - echo '[global]'; \ - echo 'daemonize = no'; \ - echo; \ - echo '[www]'; \ - echo 'listen = 9000'; \ - } | tee php-fpm.d/zz-docker.conf - -EXPOSE 9000 -CMD ["php-fpm"] -#### - -# Download script to install PHP extensions and dependencies -ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ - -RUN chmod +x /usr/local/bin/install-php-extensions - -# PEAR < 1.10.18 can't read pecl.php.net responses anymore. -RUN pear upgrade --force https://pear.php.net/get/PEAR-1.10.18.tgz - -# retry: PECL sometimes replies "No releases available" on CI runners. -RUN retry() { for i in 1 2 3; do "$@" && return; sleep 10; done; return 1; }; \ - DEBIAN_FRONTEND=noninteractive apt-get update -q \ - && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y \ - curl \ - git \ - zip unzip \ -# iconv, mbstring and pdo_sqlite are omitted as they are already installed - && PHP_EXTENSIONS=" \ - amqp \ - bcmath \ - bz2 \ - calendar \ - event \ - exif \ - gd \ - gettext \ - imagick \ - intl \ - ldap \ - mcrypt \ - memcached \ - mysql \ - mysqli \ - opcache \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - redis \ - soap \ - sockets \ - xsl \ - zip \ - " \ - && retry install-php-extensions $PHP_EXTENSIONS - -# Install Composer. -ENV PATH=$PATH:/root/composer/vendor/bin \ - COMPOSER_ALLOW_SUPERUSER=1 \ - COMPOSER_HOME=/root/composer -RUN cd /opt \ - # Download installer and check for its integrity. - && curl -sSL https://getcomposer.org/installer > composer-setup.php \ - && curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \ - && sha384sum --check composer-setup.sha384sum \ - # Install Composer 2. - && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --2 \ - # Remove installer files. - && rm /opt/composer-setup.php /opt/composer-setup.sha384sum diff --git a/compat/Makefile b/compat/Makefile index 283ca91..64ea852 100644 --- a/compat/Makefile +++ b/compat/Makefile @@ -2,6 +2,7 @@ SHELL := /bin/bash ALL: build .PHONY: build test push +PARENT_IMAGE := chialab/php IMAGE := chialab/php-compat VERSION ?= latest PHP_VERSION = $(firstword $(subst -, ,$(VERSION))) @@ -43,7 +44,7 @@ endif build: @echo " =====> Building $(REGISTRY)$(IMAGE):$(VERSION)..." - docker image build --quiet --build-context patches=../eol/patches -f Dockerfile.$(VERSION) -t $(REGISTRY)$(IMAGE):$(VERSION) . + docker image build --quiet --build-arg 'BASE_IMAGE=$(PARENT_IMAGE):$(VERSION)' -t $(REGISTRY)$(IMAGE):$(VERSION) . test: @echo -e "=====> Testing loaded extensions... \c" diff --git a/compat/README.md b/compat/README.md index a3ee651..b7a7f8a 100644 --- a/compat/README.md +++ b/compat/README.md @@ -1,30 +1,20 @@ -

- - Docker PHP Images logo - -

+# Docker PHP images: compat -

- Docker PHP images -

- -

- GitHub Workflow Status - Source link - Authors link - Docker Pulls - License -

- ---- +[![PHP 5 build](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/test.5.yml?branch=main&label=PHP%205&style=flat-square)](https://github.com/chialab/docker-php/actions/workflows/test.5.yml?query=branch%3Amain) +[![Source link](https://img.shields.io/badge/Source-GitHub-lightgrey.svg?style=flat-square)](https://github.com/chialab/docker-php) +[![Authors link](https://img.shields.io/badge/Authors-Chialab-lightgrey.svg?style=flat-square)](https://www.chialab.it) +[![Docker Pulls](https://img.shields.io/docker/pulls/chialab/php-compat.svg?style=flat-square)](https://hub.docker.com/r/chialab/php-compat/) +[![License](https://img.shields.io/github/license/chialab/docker-php.svg?style=flat-square)](https://github.com/chialab/docker-php/blob/main/LICENSE) Compatibility docker images. ### PHP 5.6 -Built from the latest official PHP 5.6 Dockerfiles ([this](https://github.com/docker-library/php/tree/783878384a8f3953ed571e5a34ba0fe546726c85) commit), -with PHP compiled to use MariaDB's `libmysqlclient` connector. This fixes connections with MySQL 8.0+, which uses a default -collation not recognized by the official image's `mysqlnd` connector (`utf8mb4`). +Built on top of [`chialab/php:5.6`](../README.md) (same tag), with the `mysql`, `mysqli` and `pdo_mysql` extensions rebuilt +against MariaDB's `libmysqlclient` connector instead of `mysqlnd`. Unlike `mysqlnd` 5.6, it can connect to MySQL 8.0+ servers +whose default authentication plugin is `caching_sha2_password`, as long as the account uses `mysql_native_password`. Accounts +using `caching_sha2_password` aren't supported, and the `mysqlnd`-only APIs (such as `mysqli_stmt::get_result()`) aren't +available. ## Available tags - `5.6` @@ -79,4 +69,4 @@ Pull requests are welcome, too! 😁 Please, run `make build` and `make test` be ## License -Docker PHP Images is released under the [MIT](https://github.com/chialab/docker-php/blob/master/LICENSE) license. +Docker PHP Images is released under the [MIT](https://github.com/chialab/docker-php/blob/main/LICENSE) license. diff --git a/dev/README.md b/dev/README.md index 4218d3f..fbef6dd 100644 --- a/dev/README.md +++ b/dev/README.md @@ -1,22 +1,13 @@ -

- - Docker PHP Images logo - -

- -

- Docker PHP images -

- -

- GitHub Workflow Status - Source link - Authors link - Docker Pulls - License -

+# Docker PHP images: dev ---- +[![PHP 5 build](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/test.5.yml?branch=main&label=PHP%205&style=flat-square)](https://github.com/chialab/docker-php/actions/workflows/test.5.yml?query=branch%3Amain) +[![PHP 7 build](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/test.7.yml?branch=main&label=PHP%207&style=flat-square)](https://github.com/chialab/docker-php/actions/workflows/test.7.yml?query=branch%3Amain) +[![PHP 8 build](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/test.8.yml?branch=main&label=PHP%208&style=flat-square)](https://github.com/chialab/docker-php/actions/workflows/test.8.yml?query=branch%3Amain) +[![latest build](https://img.shields.io/github/actions/workflow/status/chialab/docker-php/test.latest.yml?branch=main&label=latest&style=flat-square)](https://github.com/chialab/docker-php/actions/workflows/test.latest.yml?query=branch%3Amain) +[![Source link](https://img.shields.io/badge/Source-GitHub-lightgrey.svg?style=flat-square)](https://github.com/chialab/docker-php) +[![Authors link](https://img.shields.io/badge/Authors-Chialab-lightgrey.svg?style=flat-square)](https://www.chialab.it) +[![Docker Pulls](https://img.shields.io/docker/pulls/chialab/php-dev.svg?style=flat-square)](https://hub.docker.com/r/chialab/php-dev/) +[![License](https://img.shields.io/github/license/chialab/docker-php.svg?style=flat-square)](https://github.com/chialab/docker-php/blob/main/LICENSE) Docker images built on top of the [official PHP images](https://hub.docker.com/r/_/php/) with the addition of some common and useful extensions, installed with [mlocati/docker-php-extension-installer](https://github.com/mlocati/docker-php-extension-installer), and are meant for *debugging purposes*. You can find these images on the [Docker Hub](https://hub.docker.com/r/chialab/php-dev/) (and if you're reading this file, you're probably already there). @@ -129,4 +120,4 @@ Pull requests are welcome, too! 😁 Please, run `make build` and `make test` be ## License -Docker PHP Images is released under the [MIT](https://github.com/chialab/docker-php/blob/master/LICENSE) license. +Docker PHP Images is released under the [MIT](https://github.com/chialab/docker-php/blob/main/LICENSE) license. diff --git a/eol/5.6/apache/Dockerfile b/eol/5.6/apache/Dockerfile index 0df7ef2..296e542 100644 --- a/eol/5.6/apache/Dockerfile +++ b/eol/5.6/apache/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/37a17e9a4ea67d5422411675b8564860dcf4cc22/php-37a17e9a4ea67d5422411675b8564860dcf4cc22.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:stretch-slim # chialab: Debian stretch has been moved to archive.debian.org. @@ -171,15 +176,17 @@ RUN set -xe; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/fab49d4cb1c61e4f74c2dffe06961408212f054c/5.6/stretch/apache +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=5.6,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-5.6.40-105" +LABEL it.chialab.php.patches="deb.sury.org-5.6.40-105" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.5.6,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -269,16 +276,18 @@ RUN set -eux; \ pecl update-channels; \ rm -rf /tmp/pear ~/.pearrc -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/5.6 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/5.6 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/apache /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ ENTRYPOINT ["docker-php-entrypoint"] #### -# chialab: from eol/scripts. -COPY --from=scripts apache2-foreground /usr/local/bin/ +# chialab: from the source commit. +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/apache2-foreground /usr/local/bin/ WORKDIR /var/www/html EXPOSE 80 diff --git a/eol/5.6/cli/Dockerfile b/eol/5.6/cli/Dockerfile index a0b59d5..5388080 100644 --- a/eol/5.6/cli/Dockerfile +++ b/eol/5.6/cli/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/37a17e9a4ea67d5422411675b8564860dcf4cc22/php-37a17e9a4ea67d5422411675b8564860dcf4cc22.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:stretch-slim # chialab: Debian stretch has been moved to archive.debian.org. @@ -111,15 +116,17 @@ RUN set -xe; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/fab49d4cb1c61e4f74c2dffe06961408212f054c/5.6/stretch/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=5.6,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-5.6.40-105" +LABEL it.chialab.php.patches="deb.sury.org-5.6.40-105" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.5.6,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -209,11 +216,13 @@ RUN set -eux; \ pecl update-channels; \ rm -rf /tmp/pear ~/.pearrc -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/5.6 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/5.6 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ ENTRYPOINT ["docker-php-entrypoint"] #### diff --git a/eol/5.6/fpm/Dockerfile b/eol/5.6/fpm/Dockerfile index 6649c59..892c217 100644 --- a/eol/5.6/fpm/Dockerfile +++ b/eol/5.6/fpm/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/37a17e9a4ea67d5422411675b8564860dcf4cc22/php-37a17e9a4ea67d5422411675b8564860dcf4cc22.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:stretch-slim # chialab: Debian stretch has been moved to archive.debian.org. @@ -112,15 +117,17 @@ RUN set -xe; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/fab49d4cb1c61e4f74c2dffe06961408212f054c/5.6/stretch/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=5.6,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-5.6.40-105" +LABEL it.chialab.php.patches="deb.sury.org-5.6.40-105" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.5.6,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -210,11 +217,13 @@ RUN set -eux; \ pecl update-channels; \ rm -rf /tmp/pear ~/.pearrc -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/5.6 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/5.6 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ ENTRYPOINT ["docker-php-entrypoint"] #### diff --git a/eol/7.0/apache/Dockerfile b/eol/7.0/apache/Dockerfile index 847cd11..90d9126 100644 --- a/eol/7.0/apache/Dockerfile +++ b/eol/7.0/apache/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/9521952fd4f62fc7a1ddafa42588c07b93736e04/php-9521952fd4f62fc7a1ddafa42588c07b93736e04.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:stretch-slim # chialab: Debian stretch has been moved to archive.debian.org. @@ -165,15 +170,17 @@ RUN set -xe; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/0e5c984e02d9027c25794bfb5002a2f9da26a7ec/7.0/stretch/apache +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.0,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.0.33-93" +LABEL it.chialab.php.patches="deb.sury.org-7.0.33-93" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.0,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -263,16 +270,18 @@ RUN set -eux; \ pecl update-channels; \ rm -rf /tmp/pear ~/.pearrc -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/5.6 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/5.6 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/apache /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ ENTRYPOINT ["docker-php-entrypoint"] #### -# chialab: from eol/scripts. -COPY --from=scripts apache2-foreground /usr/local/bin/ +# chialab: from the source commit. +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/apache2-foreground /usr/local/bin/ WORKDIR /var/www/html EXPOSE 80 diff --git a/eol/7.0/cli/Dockerfile b/eol/7.0/cli/Dockerfile index 045ba66..0e0b6b6 100644 --- a/eol/7.0/cli/Dockerfile +++ b/eol/7.0/cli/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/9521952fd4f62fc7a1ddafa42588c07b93736e04/php-9521952fd4f62fc7a1ddafa42588c07b93736e04.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:stretch-slim # chialab: Debian stretch has been moved to archive.debian.org. @@ -105,15 +110,17 @@ RUN set -xe; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/0e5c984e02d9027c25794bfb5002a2f9da26a7ec/7.0/stretch/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.0,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.0.33-93" +LABEL it.chialab.php.patches="deb.sury.org-7.0.33-93" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.0,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -203,11 +210,13 @@ RUN set -eux; \ pecl update-channels; \ rm -rf /tmp/pear ~/.pearrc -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/5.6 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/5.6 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ ENTRYPOINT ["docker-php-entrypoint"] #### diff --git a/eol/7.0/fpm/Dockerfile b/eol/7.0/fpm/Dockerfile index e3d4094..d239372 100644 --- a/eol/7.0/fpm/Dockerfile +++ b/eol/7.0/fpm/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/9521952fd4f62fc7a1ddafa42588c07b93736e04/php-9521952fd4f62fc7a1ddafa42588c07b93736e04.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:stretch-slim # chialab: Debian stretch has been moved to archive.debian.org. @@ -106,15 +111,17 @@ RUN set -xe; \ \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/0e5c984e02d9027c25794bfb5002a2f9da26a7ec/7.0/stretch/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.0,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.0.33-93" +LABEL it.chialab.php.patches="deb.sury.org-7.0.33-93" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.0,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -204,11 +211,13 @@ RUN set -eux; \ pecl update-channels; \ rm -rf /tmp/pear ~/.pearrc -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/5.6 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/5.6 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ ENTRYPOINT ["docker-php-entrypoint"] #### diff --git a/eol/7.1/alpine/Dockerfile b/eol/7.1/alpine/Dockerfile index 7ce1c21..1aca917 100644 --- a/eol/7.1/alpine/Dockerfile +++ b/eol/7.1/alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/a88ccf5051d416b9f47faf85df9b7b875e111a71/php-a88ccf5051d416b9f47faf85df9b7b875e111a71.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.10 # dependencies required for running "phpize" @@ -97,15 +102,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/2bf33a859340cf4932a7bce5ae7bc935fc778b9d/7.1/alpine3.10/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.1.33-81" +LABEL it.chialab.php.patches="deb.sury.org-7.1.33-81" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -185,11 +192,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.1 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ ENTRYPOINT ["docker-php-entrypoint"] #### diff --git a/eol/7.1/apache/Dockerfile b/eol/7.1/apache/Dockerfile index f588db2..e80aff2 100644 --- a/eol/7.1/apache/Dockerfile +++ b/eol/7.1/apache/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/a88ccf5051d416b9f47faf85df9b7b875e111a71/php-a88ccf5051d416b9f47faf85df9b7b875e111a71.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:buster-slim # chialab: Debian buster has been moved to archive.debian.org. @@ -169,15 +174,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/2bf33a859340cf4932a7bce5ae7bc935fc778b9d/7.1/buster/apache +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.1.33-81" +LABEL it.chialab.php.patches="deb.sury.org-7.1.33-81" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -271,11 +278,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.1 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/apache /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # temporary "freetype-config" workaround for https://github.com/docker-library/php/issues/865 (https://bugs.php.net/bug.php?id=76324) RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config @@ -285,8 +294,8 @@ ENTRYPOINT ["docker-php-entrypoint"] # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL SIGWINCH -# chialab: from eol/scripts. -COPY --from=scripts apache2-foreground /usr/local/bin/ +# chialab: from the source commit. +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/apache2-foreground /usr/local/bin/ WORKDIR /var/www/html EXPOSE 80 diff --git a/eol/7.1/cli/Dockerfile b/eol/7.1/cli/Dockerfile index ba46a86..d4cc094 100644 --- a/eol/7.1/cli/Dockerfile +++ b/eol/7.1/cli/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/a88ccf5051d416b9f47faf85df9b7b875e111a71/php-a88ccf5051d416b9f47faf85df9b7b875e111a71.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:buster-slim # chialab: Debian buster has been moved to archive.debian.org. @@ -109,15 +114,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/2bf33a859340cf4932a7bce5ae7bc935fc778b9d/7.1/buster/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.1.33-81" +LABEL it.chialab.php.patches="deb.sury.org-7.1.33-81" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -211,11 +218,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.1 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # temporary "freetype-config" workaround for https://github.com/docker-library/php/issues/865 (https://bugs.php.net/bug.php?id=76324) RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config diff --git a/eol/7.1/fpm-alpine/Dockerfile b/eol/7.1/fpm-alpine/Dockerfile index fc1c2f1..0e49528 100644 --- a/eol/7.1/fpm-alpine/Dockerfile +++ b/eol/7.1/fpm-alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/a88ccf5051d416b9f47faf85df9b7b875e111a71/php-a88ccf5051d416b9f47faf85df9b7b875e111a71.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.10 # dependencies required for running "phpize" @@ -98,15 +103,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/2bf33a859340cf4932a7bce5ae7bc935fc778b9d/7.1/alpine3.10/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.1.33-81" +LABEL it.chialab.php.patches="deb.sury.org-7.1.33-81" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -186,11 +193,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.1 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ ENTRYPOINT ["docker-php-entrypoint"] #### diff --git a/eol/7.1/fpm/Dockerfile b/eol/7.1/fpm/Dockerfile index 0f3fd20..f6f53b2 100644 --- a/eol/7.1/fpm/Dockerfile +++ b/eol/7.1/fpm/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/a88ccf5051d416b9f47faf85df9b7b875e111a71/php-a88ccf5051d416b9f47faf85df9b7b875e111a71.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:buster-slim # chialab: Debian buster has been moved to archive.debian.org. @@ -110,15 +115,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/2bf33a859340cf4932a7bce5ae7bc935fc778b9d/7.1/buster/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.1.33-81" +LABEL it.chialab.php.patches="deb.sury.org-7.1.33-81" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -212,11 +219,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/5.6 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.1 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # temporary "freetype-config" workaround for https://github.com/docker-library/php/issues/865 (https://bugs.php.net/bug.php?id=76324) RUN { echo '#!/bin/sh'; echo 'exec pkg-config "$@" freetype2'; } > /usr/local/bin/freetype-config && chmod +x /usr/local/bin/freetype-config diff --git a/eol/7.2/alpine/Dockerfile b/eol/7.2/alpine/Dockerfile index 8e6d372..851d088 100644 --- a/eol/7.2/alpine/Dockerfile +++ b/eol/7.2/alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e0bcd488d9f8da024d9e1a254113539a846cac6d/php-e0bcd488d9f8da024d9e1a254113539a846cac6d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.12 # dependencies required for running "phpize" @@ -89,15 +94,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/20ebff40bb865416f3767540df06ad1df384337d/7.2/alpine3.12/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.2,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.2.34-66" +LABEL it.chialab.php.patches="deb.sury.org-7.2.34-66" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.2,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -187,11 +194,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.2 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.2 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.2/apache/Dockerfile b/eol/7.2/apache/Dockerfile index c9626a0..6125644 100644 --- a/eol/7.2/apache/Dockerfile +++ b/eol/7.2/apache/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e0bcd488d9f8da024d9e1a254113539a846cac6d/php-e0bcd488d9f8da024d9e1a254113539a846cac6d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:buster-slim # chialab: Debian buster has been moved to archive.debian.org. @@ -162,15 +167,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/20ebff40bb865416f3767540df06ad1df384337d/7.2/buster/apache +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.2,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.2.34-66" +LABEL it.chialab.php.patches="deb.sury.org-7.2.34-66" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.2,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -274,11 +281,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.2 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.2 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/apache /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium @@ -290,8 +299,8 @@ ENTRYPOINT ["docker-php-entrypoint"] # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL SIGWINCH -# chialab: from eol/scripts. -COPY --from=scripts apache2-foreground /usr/local/bin/ +# chialab: from the source commit. +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/apache2-foreground /usr/local/bin/ WORKDIR /var/www/html EXPOSE 80 diff --git a/eol/7.2/cli/Dockerfile b/eol/7.2/cli/Dockerfile index ea0a79c..728bf73 100644 --- a/eol/7.2/cli/Dockerfile +++ b/eol/7.2/cli/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e0bcd488d9f8da024d9e1a254113539a846cac6d/php-e0bcd488d9f8da024d9e1a254113539a846cac6d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:buster-slim # chialab: Debian buster has been moved to archive.debian.org. @@ -101,15 +106,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/20ebff40bb865416f3767540df06ad1df384337d/7.2/buster/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.2,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.2.34-66" +LABEL it.chialab.php.patches="deb.sury.org-7.2.34-66" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.2,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -213,11 +220,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.2 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.2 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.2/fpm-alpine/Dockerfile b/eol/7.2/fpm-alpine/Dockerfile index bcd88cd..f68d780 100644 --- a/eol/7.2/fpm-alpine/Dockerfile +++ b/eol/7.2/fpm-alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e0bcd488d9f8da024d9e1a254113539a846cac6d/php-e0bcd488d9f8da024d9e1a254113539a846cac6d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.12 # dependencies required for running "phpize" @@ -91,15 +96,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/20ebff40bb865416f3767540df06ad1df384337d/7.2/alpine3.12/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.2,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.2.34-66" +LABEL it.chialab.php.patches="deb.sury.org-7.2.34-66" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.2,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -189,11 +196,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.2 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.2 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.2/fpm/Dockerfile b/eol/7.2/fpm/Dockerfile index a50e629..4a88221 100644 --- a/eol/7.2/fpm/Dockerfile +++ b/eol/7.2/fpm/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e0bcd488d9f8da024d9e1a254113539a846cac6d/php-e0bcd488d9f8da024d9e1a254113539a846cac6d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:buster-slim # chialab: Debian buster has been moved to archive.debian.org. @@ -103,15 +108,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/20ebff40bb865416f3767540df06ad1df384337d/7.2/buster/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.2,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.2.34-66" +LABEL it.chialab.php.patches="deb.sury.org-7.2.34-66" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.2,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -215,11 +222,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.2 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.2 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.3/alpine/Dockerfile b/eol/7.3/alpine/Dockerfile index 1c34115..4386422 100644 --- a/eol/7.3/alpine/Dockerfile +++ b/eol/7.3/alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/ecf76f6726bee03657a2c608240685732312fe54/php-ecf76f6726bee03657a2c608240685732312fe54.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.15 # dependencies required for running "phpize" @@ -87,15 +92,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/35d0a696b273c31f41ae224f189c19e794df91ae/7.3/alpine3.15/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.3,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.3.33-35" +LABEL it.chialab.php.patches="deb.sury.org-7.3.33-35" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.3,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -202,11 +209,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.3 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.3/apache/Dockerfile b/eol/7.3/apache/Dockerfile index a4208b4..0f85619 100644 --- a/eol/7.3/apache/Dockerfile +++ b/eol/7.3/apache/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/ecf76f6726bee03657a2c608240685732312fe54/php-ecf76f6726bee03657a2c608240685732312fe54.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:bullseye-slim # chialab: Debian bullseye has been moved to archive.debian.org. @@ -158,15 +163,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/35d0a696b273c31f41ae224f189c19e794df91ae/7.3/bullseye/apache +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.3,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.3.33-35" +LABEL it.chialab.php.patches="deb.sury.org-7.3.33-35" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.3,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -283,11 +290,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.3 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/apache /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium @@ -299,8 +308,8 @@ ENTRYPOINT ["docker-php-entrypoint"] # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL SIGWINCH -# chialab: from eol/scripts. -COPY --from=scripts apache2-foreground /usr/local/bin/ +# chialab: from the source commit. +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/apache2-foreground /usr/local/bin/ WORKDIR /var/www/html EXPOSE 80 diff --git a/eol/7.3/cli/Dockerfile b/eol/7.3/cli/Dockerfile index 5fd38d0..b6b687a 100644 --- a/eol/7.3/cli/Dockerfile +++ b/eol/7.3/cli/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/ecf76f6726bee03657a2c608240685732312fe54/php-ecf76f6726bee03657a2c608240685732312fe54.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:bullseye-slim # chialab: Debian bullseye has been moved to archive.debian.org. @@ -100,15 +105,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/35d0a696b273c31f41ae224f189c19e794df91ae/7.3/bullseye/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.3,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.3.33-35" +LABEL it.chialab.php.patches="deb.sury.org-7.3.33-35" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.3,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -224,11 +231,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.3 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.3/fpm-alpine/Dockerfile b/eol/7.3/fpm-alpine/Dockerfile index 158829a..82889a6 100644 --- a/eol/7.3/fpm-alpine/Dockerfile +++ b/eol/7.3/fpm-alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/ecf76f6726bee03657a2c608240685732312fe54/php-ecf76f6726bee03657a2c608240685732312fe54.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.15 # dependencies required for running "phpize" @@ -87,15 +92,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/35d0a696b273c31f41ae224f189c19e794df91ae/7.3/alpine3.15/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.3,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.3.33-35" +LABEL it.chialab.php.patches="deb.sury.org-7.3.33-35" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.3,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -207,11 +214,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.3 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.3/fpm/Dockerfile b/eol/7.3/fpm/Dockerfile index 91c2142..407f5ca 100644 --- a/eol/7.3/fpm/Dockerfile +++ b/eol/7.3/fpm/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/ecf76f6726bee03657a2c608240685732312fe54/php-ecf76f6726bee03657a2c608240685732312fe54.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:bullseye-slim # chialab: Debian bullseye has been moved to archive.debian.org. @@ -100,15 +105,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/35d0a696b273c31f41ae224f189c19e794df91ae/7.3/bullseye/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.3,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.3.33-35" +LABEL it.chialab.php.patches="deb.sury.org-7.3.33-35" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.3,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -226,11 +233,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.3 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.4/alpine/Dockerfile b/eol/7.4/alpine/Dockerfile index b4d7c46..a0e68d0 100644 --- a/eol/7.4/alpine/Dockerfile +++ b/eol/7.4/alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e9c428802984a79e6e2e1f505404322e6fe7ba8d/php-e9c428802984a79e6e2e1f505404322e6fe7ba8d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.16 # dependencies required for running "phpize" @@ -87,15 +92,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/1361ba95d80570e3984f9de9f765948246191557/7.4/alpine3.16/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.4,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.4.33-31" +LABEL it.chialab.php.patches="deb.sury.org-7.4.33-31" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.4,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -207,11 +214,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.4/apache/Dockerfile b/eol/7.4/apache/Dockerfile index a652345..a456538 100644 --- a/eol/7.4/apache/Dockerfile +++ b/eol/7.4/apache/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e9c428802984a79e6e2e1f505404322e6fe7ba8d/php-e9c428802984a79e6e2e1f505404322e6fe7ba8d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:bullseye-slim # chialab: Debian bullseye has been moved to archive.debian.org. @@ -158,15 +163,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/1361ba95d80570e3984f9de9f765948246191557/7.4/bullseye/apache +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.4,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.4.33-31" +LABEL it.chialab.php.patches="deb.sury.org-7.4.33-31" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.4,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -287,11 +294,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/apache /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium @@ -300,8 +309,8 @@ ENTRYPOINT ["docker-php-entrypoint"] # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL SIGWINCH -# chialab: from eol/scripts. -COPY --from=scripts apache2-foreground /usr/local/bin/ +# chialab: from the source commit. +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/apache2-foreground /usr/local/bin/ WORKDIR /var/www/html EXPOSE 80 diff --git a/eol/7.4/cli/Dockerfile b/eol/7.4/cli/Dockerfile index fd3ff1f..7d4fcd6 100644 --- a/eol/7.4/cli/Dockerfile +++ b/eol/7.4/cli/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e9c428802984a79e6e2e1f505404322e6fe7ba8d/php-e9c428802984a79e6e2e1f505404322e6fe7ba8d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:bullseye-slim # chialab: Debian bullseye has been moved to archive.debian.org. @@ -100,15 +105,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/1361ba95d80570e3984f9de9f765948246191557/7.4/bullseye/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.4,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.4.33-31" +LABEL it.chialab.php.patches="deb.sury.org-7.4.33-31" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.4,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -228,11 +235,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.4/fpm-alpine/Dockerfile b/eol/7.4/fpm-alpine/Dockerfile index a0933a4..f859d10 100644 --- a/eol/7.4/fpm-alpine/Dockerfile +++ b/eol/7.4/fpm-alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e9c428802984a79e6e2e1f505404322e6fe7ba8d/php-e9c428802984a79e6e2e1f505404322e6fe7ba8d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.16 # dependencies required for running "phpize" @@ -87,15 +92,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/1361ba95d80570e3984f9de9f765948246191557/7.4/alpine3.16/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.4,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.4.33-31" +LABEL it.chialab.php.patches="deb.sury.org-7.4.33-31" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.4,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -212,11 +219,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/7.4/fpm/Dockerfile b/eol/7.4/fpm/Dockerfile index 2ba20b7..2732d5f 100644 --- a/eol/7.4/fpm/Dockerfile +++ b/eol/7.4/fpm/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/e9c428802984a79e6e2e1f505404322e6fe7ba8d/php-e9c428802984a79e6e2e1f505404322e6fe7ba8d.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:bullseye-slim # chialab: Debian bullseye has been moved to archive.debian.org. @@ -100,15 +105,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/1361ba95d80570e3984f9de9f765948246191557/7.4/bullseye/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=7.4,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-7.4.33-31" +LABEL it.chialab.php.patches="deb.sury.org-7.4.33-31" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.7.4,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -230,11 +237,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/8.0/alpine/Dockerfile b/eol/8.0/alpine/Dockerfile index 2be2802..d36375a 100644 --- a/eol/8.0/alpine/Dockerfile +++ b/eol/8.0/alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/abebea27da1d5cf90a0e83ab81ea3e708886aebb/php-abebea27da1d5cf90a0e83ab81ea3e708886aebb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.16 # dependencies required for running "phpize" @@ -87,15 +92,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/df4636cac888ec860ccbf0f200637b88a2fb22ab/8.0/alpine3.16/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.0,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.0.30-25" +LABEL it.chialab.php.patches="deb.sury.org-8.0.30-25" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.0,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -205,11 +212,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/8.0/apache/Dockerfile b/eol/8.0/apache/Dockerfile index 7f2531e..1a7d9ab 100644 --- a/eol/8.0/apache/Dockerfile +++ b/eol/8.0/apache/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/abebea27da1d5cf90a0e83ab81ea3e708886aebb/php-abebea27da1d5cf90a0e83ab81ea3e708886aebb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:bullseye-slim # chialab: Debian bullseye has been moved to archive.debian.org. @@ -158,15 +163,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/df4636cac888ec860ccbf0f200637b88a2fb22ab/8.0/bullseye/apache +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.0,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.0.30-25" +LABEL it.chialab.php.patches="deb.sury.org-8.0.30-25" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.0,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -287,11 +294,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/apache /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium @@ -300,8 +309,8 @@ ENTRYPOINT ["docker-php-entrypoint"] # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL SIGWINCH -# chialab: from eol/scripts. -COPY --from=scripts apache2-foreground /usr/local/bin/ +# chialab: from the source commit. +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/apache2-foreground /usr/local/bin/ WORKDIR /var/www/html EXPOSE 80 diff --git a/eol/8.0/cli/Dockerfile b/eol/8.0/cli/Dockerfile index d237b26..54baaa8 100644 --- a/eol/8.0/cli/Dockerfile +++ b/eol/8.0/cli/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/abebea27da1d5cf90a0e83ab81ea3e708886aebb/php-abebea27da1d5cf90a0e83ab81ea3e708886aebb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:bullseye-slim # chialab: Debian bullseye has been moved to archive.debian.org. @@ -100,15 +105,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/df4636cac888ec860ccbf0f200637b88a2fb22ab/8.0/bullseye/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.0,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.0.30-25" +LABEL it.chialab.php.patches="deb.sury.org-8.0.30-25" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.0,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -228,11 +235,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/8.0/fpm-alpine/Dockerfile b/eol/8.0/fpm-alpine/Dockerfile index f2ed862..37c6c85 100644 --- a/eol/8.0/fpm-alpine/Dockerfile +++ b/eol/8.0/fpm-alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/abebea27da1d5cf90a0e83ab81ea3e708886aebb/php-abebea27da1d5cf90a0e83ab81ea3e708886aebb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.16 # dependencies required for running "phpize" @@ -87,15 +92,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/df4636cac888ec860ccbf0f200637b88a2fb22ab/8.0/alpine3.16/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.0,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.0.30-25" +LABEL it.chialab.php.patches="deb.sury.org-8.0.30-25" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.0,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -210,11 +217,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/8.0/fpm/Dockerfile b/eol/8.0/fpm/Dockerfile index a7a1ad1..6dea32b 100644 --- a/eol/8.0/fpm/Dockerfile +++ b/eol/8.0/fpm/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/abebea27da1d5cf90a0e83ab81ea3e708886aebb/php-abebea27da1d5cf90a0e83ab81ea3e708886aebb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:bullseye-slim # chialab: Debian bullseye has been moved to archive.debian.org. @@ -100,15 +105,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/df4636cac888ec860ccbf0f200637b88a2fb22ab/8.0/bullseye/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.0,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.0.30-25" +LABEL it.chialab.php.patches="deb.sury.org-8.0.30-25" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.0,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -230,11 +237,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/7.4 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # sodium was built as a shared module (so that it can be replaced later if so desired), so let's enable it too (https://github.com/docker-library/php/issues/598) RUN docker-php-ext-enable sodium diff --git a/eol/8.1/alpine/Dockerfile b/eol/8.1/alpine/Dockerfile index b05de84..fafd9a4 100644 --- a/eol/8.1/alpine/Dockerfile +++ b/eol/8.1/alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/4e430ad99622d9fabcee27d6dba438c81de716eb/php-4e430ad99622d9fabcee27d6dba438c81de716eb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.21 # dependencies required for running "phpize" @@ -84,15 +89,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/5c037abaf9dc0095e29807c048d9d1b97e6a9716/8.1/alpine3.21/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.1.34-9" +LABEL it.chialab.php.patches="deb.sury.org-8.1.34-9" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -226,11 +233,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/8.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) RUN docker-php-ext-enable opcache diff --git a/eol/8.1/apache/Dockerfile b/eol/8.1/apache/Dockerfile index 4c312ca..a7026cd 100644 --- a/eol/8.1/apache/Dockerfile +++ b/eol/8.1/apache/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/4e430ad99622d9fabcee27d6dba438c81de716eb/php-4e430ad99622d9fabcee27d6dba438c81de716eb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:trixie-slim # prevent Debian's PHP packages from being installed @@ -153,15 +158,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/5c037abaf9dc0095e29807c048d9d1b97e6a9716/8.1/trixie/apache +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.1.34-9" +LABEL it.chialab.php.patches="deb.sury.org-8.1.34-9" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -287,11 +294,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/8.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/apache /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) RUN docker-php-ext-enable opcache @@ -303,8 +312,8 @@ ENTRYPOINT ["docker-php-entrypoint"] # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop STOPSIGNAL SIGWINCH -# chialab: from eol/scripts. -COPY --from=scripts apache2-foreground /usr/local/bin/ +# chialab: from the source commit. +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/apache2-foreground /usr/local/bin/ WORKDIR /var/www/html EXPOSE 80 diff --git a/eol/8.1/cli/Dockerfile b/eol/8.1/cli/Dockerfile index 0ac5fd7..ab8d67f 100644 --- a/eol/8.1/cli/Dockerfile +++ b/eol/8.1/cli/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/4e430ad99622d9fabcee27d6dba438c81de716eb/php-4e430ad99622d9fabcee27d6dba438c81de716eb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:trixie-slim # prevent Debian's PHP packages from being installed @@ -93,15 +98,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/5c037abaf9dc0095e29807c048d9d1b97e6a9716/8.1/trixie/cli +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.1.34-9" +LABEL it.chialab.php.patches="deb.sury.org-8.1.34-9" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -226,11 +233,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/8.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/cli /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) RUN docker-php-ext-enable opcache diff --git a/eol/8.1/fpm-alpine/Dockerfile b/eol/8.1/fpm-alpine/Dockerfile index 830519f..47b1e2e 100644 --- a/eol/8.1/fpm-alpine/Dockerfile +++ b/eol/8.1/fpm-alpine/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/4e430ad99622d9fabcee27d6dba438c81de716eb/php-4e430ad99622d9fabcee27d6dba438c81de716eb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM alpine:3.21 # dependencies required for running "phpize" @@ -84,15 +89,17 @@ RUN set -eux; \ \ apk del --no-network .fetch-deps -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/5c037abaf9dc0095e29807c048d9d1b97e6a9716/8.1/alpine3.21/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.1.34-9" +LABEL it.chialab.php.patches="deb.sury.org-8.1.34-9" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -231,11 +238,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/8.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) RUN docker-php-ext-enable opcache diff --git a/eol/8.1/fpm/Dockerfile b/eol/8.1/fpm/Dockerfile index 96c920c..70eb09e 100644 --- a/eol/8.1/fpm/Dockerfile +++ b/eol/8.1/fpm/Dockerfile @@ -4,6 +4,11 @@ # with the changes marked "chialab:". # +# chialab: deb.sury.org's patches for this version, from the Salsa commit of the build named in PHP_PATCHES. +FROM scratch AS deb-patches +ARG DEB_PATCHES=https://salsa.debian.org/php-team/php/-/archive/4e430ad99622d9fabcee27d6dba438c81de716eb/php-4e430ad99622d9fabcee27d6dba438c81de716eb.tar.gz?path=debian/patches +ADD --unpack=true $DEB_PATCHES / + FROM debian:trixie-slim # prevent Debian's PHP packages from being installed @@ -93,15 +98,17 @@ RUN set -eux; \ apt-mark manual $savedAptMark > /dev/null; \ apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -# chialab: helper scripts are shared by all eol/ images, see eol/scripts. -COPY --from=scripts docker-php-source /usr/local/bin/ +# chialab: helper scripts are added from the source commit. +ARG DOCKER_PHP_SCRIPTS=https://raw.githubusercontent.com/docker-library/php/5c037abaf9dc0095e29807c048d9d1b97e6a9716/8.1/trixie/fpm +ADD --chmod=755 $DOCKER_PHP_SCRIPTS/docker-php-source /usr/local/bin/ # chialab: security backports for this EOL version (see eol/patches). -ENV PHP_PATCHES="CVE-2026-109618 CVE-2026-109619" -LABEL it.chialab.php.patches="CVE-2026-109618 CVE-2026-109619" -RUN --mount=type=bind,from=patches,source=8.1,target=/usr/src/php-patches \ +ENV PHP_PATCHES="deb.sury.org-8.1.34-9" +LABEL it.chialab.php.patches="deb.sury.org-8.1.34-9" +RUN --mount=type=bind,from=deb-patches,target=/usr/src/deb-patches \ + --mount=type=bind,from=patches,source=series.8.1,target=/usr/src/php-series \ --mount=type=bind,from=patches,source=docker-php-source-patch,target=/usr/local/bin/docker-php-source-patch \ - docker-php-source-patch /usr/src/php-patches + docker-php-source-patch /usr/src/php-series /usr/src/deb-patches RUN set -eux; \ \ @@ -228,11 +235,13 @@ RUN set -eux; \ # smoke test php --version -# chialab: from eol/scripts. -COPY --from=scripts docker-php-ext-configure/7.2 /usr/local/bin/docker-php-ext-configure -COPY --from=scripts docker-php-ext-enable/7.3 /usr/local/bin/docker-php-ext-enable -COPY --from=scripts docker-php-ext-install/8.1 /usr/local/bin/docker-php-ext-install -COPY --from=scripts docker-php-entrypoint/fpm /usr/local/bin/docker-php-entrypoint +# chialab: from the source commit. +ADD --chmod=755 \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-configure \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-enable \ + $DOCKER_PHP_SCRIPTS/docker-php-ext-install \ + $DOCKER_PHP_SCRIPTS/docker-php-entrypoint \ + /usr/local/bin/ # enable OPcache by default (https://wiki.php.net/rfc/make_opcache_required) RUN docker-php-ext-enable opcache diff --git a/eol/README.md b/eol/README.md index bb243b8..e5b4415 100644 --- a/eol/README.md +++ b/eol/README.md @@ -6,18 +6,23 @@ applied to the sources, and use the result as the base image instead of `php://Dockerfile`: the official Dockerfiles, one per tag suffix (`cli`, `apache`, `fpm`, `alpine`, `fpm-alpine`). -- `scripts/`: the helper scripts copied into the images (`docker-php-*`, `apache2-foreground`), - passed to the build as the `scripts` named context. -- `patches/`: `docker-php-source-patch` and one `/series` of patches per version, passed to - the build as the `patches` named context. +- `patches/`: `docker-php-source-patch` and one `series.` per version, passed to the build + as the `patches` named context. + +The patches are deb.sury.org's, from the Debian PHP team's +[repository on Salsa](https://salsa.debian.org/php-team/php). Each Dockerfile downloads +`debian/patches` from the Salsa commit in its `DEB_PATCHES` into a `deb-patches` stage. Each +`series.` is an allow-list over that `series`: it names every patch in the same order, with +the ones left out commented as `# : `. `docker-php-source-patch` fails the build if +the two lists differ, so a new deb.sury.org revision can't add a patch nobody has reviewed. The build picks a directory up on its own: if `eol//` exists, the Makefile and `build-images.yml` build it as the base image. No workflow lists EOL versions. ## Adding a version -Add it once there is a security patch to apply: `make test` fails an EOL image whose -`PHP_PATCHES` is empty. Until then, keep building on the official image. +Add it once deb.sury.org publishes patches for it: `make test` fails an EOL image whose `PHP_PATCHES` +is empty. Until then, keep building on the official image. 1. **Find the source.** Take the last [docker-library/php](https://github.com/docker-library/php) commit that still has the `/` directory. For each flavor, pick the variant the plain @@ -25,33 +30,39 @@ Add it once there is a security patch to apply: `make test` fails an EOL image w `/alpine/{cli,fpm}` for `alpine` and `fpm-alpine`. 2. **Copy the Dockerfiles** to `eol///Dockerfile`, with the header used by the other versions linking the exact source path at that commit. Copy only the Dockerfile, not - the scripts next to it. + the scripts next to it: the build adds them from the same commit. 3. **Mark every change** with a `# chialab:` comment: - - replace the `COPY docker-php-*` and `COPY apache2-foreground` lines with - `COPY --from=scripts …` (see [Scripts](#scripts)); - - add the patch step right after `docker-php-source` is copied, as in the other versions: - `ENV PHP_PATCHES`, `LABEL it.chialab.php.patches` and the `RUN` that bind-mounts - `patches/` and runs `docker-php-source-patch`; + - set `ARG DOCKER_PHP_SCRIPTS` to the raw URL of the source path + (`https://raw.githubusercontent.com/docker-library/php//`) just before the + first `COPY`, and replace the `COPY docker-php-*` and `COPY apache2-foreground` lines with + `ADD --chmod=755 $DOCKER_PHP_SCRIPTS/