Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 83 additions & 10 deletions .github/workflows/build-php-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,45 @@ on:

jobs:
buildx:
runs-on: ubuntu-24.04
runs-on: ${{ matrix.platform.runner }}
env:
TERM: xterm
strategy:
fail-fast: false
matrix:
include:
target: &targets
- image: php
tag: 8.5-fpm-7
context: images/8.5-fpm
min_php: 8.5.12
- image: php
tag: 8.5-apache-7
context: images/8.5-apache
min_php: 8.5.12
- image: php
tag: 8.4-fpm-7
context: images/8.4-fpm
min_php: 8.4.27
- image: php
tag: 8.4-apache-7
context: images/8.4-apache
min_php: 8.4.27
- image: php
tag: 8.3-fpm-7
context: images/8.3-fpm
min_php: 8.3.36
- image: php
tag: 8.3-apache-7
context: images/8.3-apache
min_php: 8.3.36
- image: php
tag: 8.2-fpm-7
context: images/8.2-fpm
min_php: 8.2.35
- image: php
tag: 8.2-apache-7
context: images/8.2-apache
min_php: 8.2.35
- image: php
tag: 8.1-fpm-7
context: images/8.1-fpm
Expand Down Expand Up @@ -95,11 +103,15 @@ jobs:
tag: 5.6-apache-7
context: images/5.6-apache

platform:
- runner: ubuntu-24.04
arch: amd64
- runner: ubuntu-24.04-arm
arch: arm64

steps:
- name: Checkout code
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
- name: Set tag suffix
Expand All @@ -112,12 +124,73 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push devwithlando/${{ matrix.image }}:${{ matrix.tag }}${{ steps.release.outputs.tag_suffix }}
- name: Build and push devwithlando/${{ matrix.target.image }}:${{ matrix.target.tag }}${{ steps.release.outputs.tag_suffix }}
id: build
uses: docker/build-push-action@v7
with:
context: ${{ matrix.context }}
platforms: linux/amd64,linux/arm64
context: ${{ matrix.target.context }}
platforms: linux/${{ matrix.platform.arch }}
push: true
tags: devwithlando/${{ matrix.image }}:${{ matrix.tag }}${{ steps.release.outputs.tag_suffix }}
cache-from: type=gha,scope=${{ matrix.image }}-${{ matrix.tag }}
cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.tag }}
outputs: type=image,name=devwithlando/${{ matrix.target.image }},push-by-digest=true,name-canonical=true,push=true
pull: true
build-args: MIN_PHP=${{ matrix.target.min_php }}
cache-from: type=gha,scope=${{ matrix.target.image }}-${{ matrix.target.tag }}-${{ matrix.platform.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.target.image }}-${{ matrix.target.tag }}-${{ matrix.platform.arch }}

- name: Export digest
env:
DIGEST: ${{ steps.build.outputs.digest }}
run: |
mkdir -p "$RUNNER_TEMP/digests"
touch "$RUNNER_TEMP/digests/${DIGEST#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v6
with:
name: digests-${{ matrix.target.tag }}-${{ matrix.platform.arch }}
path: ${{ runner.temp }}/digests/*
retention-days: 1

merge:
# A failed unrelated target must not block complete security-image pairs.
if: ${{ !cancelled() }}
needs: buildx
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
target: *targets
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
steps:
- name: Download amd64 digest
uses: actions/download-artifact@v7
with:
name: digests-${{ matrix.target.tag }}-amd64
path: ${{ runner.temp }}/digests/amd64
- name: Download arm64 digest
uses: actions/download-artifact@v7
with:
name: digests-${{ matrix.target.tag }}-arm64
path: ${{ runner.temp }}/digests/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish multiarch tag
working-directory: ${{ runner.temp }}/digests
env:
IMAGE: devwithlando/${{ matrix.target.image }}
TAG: ${{ matrix.target.tag }}${{ github.event_name == 'pull_request' && '-edge' || '' }}
run: |
shopt -s nullglob
amd64=(amd64/*)
arm64=(arm64/*)
test "${#amd64[@]}" -eq 1
test "${#arm64[@]}" -eq 1
digests=("${amd64[0]##*/}" "${arm64[0]##*/}")
for digest in "${digests[@]}"; do
[[ "$digest" =~ ^[a-f0-9]{64}$ ]]
done
docker buildx imagetools create --tag "$IMAGE:$TAG" "${digests[@]/#/$IMAGE@sha256:}"
docker buildx imagetools inspect "$IMAGE:$TAG"
7 changes: 5 additions & 2 deletions .github/workflows/pr-php-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ jobs:
lando-plugin: true
version: dev
sync: false
- name: Setup lando ${{ github.event.inputs.lando-version }}
- name: Setup lando ${{ github.event.inputs.lando-version || matrix.lando-version }}
uses: lando/setup-lando@v3
with:
lando-version: ${{ github.event.inputs.lando-version }}
lando-version: ${{ github.event.inputs.lando-version || matrix.lando-version }}
lando-version-file: ''
config: |
setup.skipCommonPlugins=true
setup.plugins.@lando/php=/home/runner/work/php/php
Expand All @@ -78,3 +79,5 @@ jobs:
cleanup-header: "Destroy tests"
shell: bash
stdin: true
# npm ci --production skips the local dev Leia; pin the global fallback to the lockfile version (latest needs Node >=24).
version: '0.6.7'
2 changes: 1 addition & 1 deletion .github/workflows/pr-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
os:
- windows-2022
- ubuntu-24.04
- macos-15
- macos-15-intel
node-version:
- '20'
steps:
Expand Down
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ nyc covers: lib/, recipes/, services/, types/
- Root `.lando.yml` is for docs site (vitepress), not plugin testing
- Test file `test/auth.spec.js` is placeholder ("should have tests")
- PHP config uses EJS templates (`.conf.tpl` extension)

## Multi-version docs builds

`npm run docs:mvb` temporarily checks out release tags in the current worktree. Run it only in a disposable checkout, without concurrent edits or Git operations; use `npm run docs:build` for a non-switching local docs check.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Added minimum PHP version build checks for supported PHP `8.2`–`8.5` images [#255](https://github.com/lando/php/pull/255)

## v1.12.0 - [March 8, 2026](https://github.com/lando/php/releases/tag/v1.12.0)

* Enabled `mod_headers` and `mod_expires` Apache modules by default [#243](https://github.com/lando/php/issues/243)
Expand Down
6 changes: 6 additions & 0 deletions examples/7.3/.lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ services:
type: php:7.3
via: cli
build_as_root:
- >-
sed -i
-e 's|security.debian.org/debian-security|archive.debian.org/debian-security|g'
-e 's|deb.debian.org/debian-security|archive.debian.org/debian-security|g'
/etc/apt/sources.list
- echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99ignore-release-date
- curl -sL https://deb.nodesource.com/setup_20.x | bash -
- apt-get update -y
- apt-get install -y nodejs
Expand Down
4 changes: 4 additions & 0 deletions images/7.3-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

FROM php:7.3-apache-bullseye

RUN sed -i -e 's|security.debian.org/debian-security|archive.debian.org/debian-security|g' \
-e 's|deb.debian.org/debian-security|archive.debian.org/debian-security|g' /etc/apt/sources.list \
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99ignore-release-date

# Install dependencies we need
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
&& apt -y update && apt-get install -y \
Expand Down
4 changes: 4 additions & 0 deletions images/7.3-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

FROM php:7.3-fpm-bullseye

RUN sed -i -e 's|security.debian.org/debian-security|archive.debian.org/debian-security|g' \
-e 's|deb.debian.org/debian-security|archive.debian.org/debian-security|g' /etc/apt/sources.list \
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99ignore-release-date

# Install dependencies we need
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
&& apt -y update && apt-get install -y \
Expand Down
4 changes: 4 additions & 0 deletions images/7.4-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

FROM php:7.4-apache-bullseye

RUN sed -i -e 's|security.debian.org/debian-security|archive.debian.org/debian-security|g' \
-e 's|deb.debian.org/debian-security|archive.debian.org/debian-security|g' /etc/apt/sources.list \
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99ignore-release-date

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN \
Expand Down
4 changes: 4 additions & 0 deletions images/7.4-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

FROM php:7.4-fpm-bullseye

RUN sed -i -e 's|security.debian.org/debian-security|archive.debian.org/debian-security|g' \
-e 's|deb.debian.org/debian-security|archive.debian.org/debian-security|g' /etc/apt/sources.list \
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99ignore-release-date

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN \
Expand Down
4 changes: 4 additions & 0 deletions images/8.0-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

FROM php:8.0-apache-bullseye

RUN sed -i -e 's|security.debian.org/debian-security|archive.debian.org/debian-security|g' \
-e 's|deb.debian.org/debian-security|archive.debian.org/debian-security|g' /etc/apt/sources.list \
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99ignore-release-date

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

ENV IPE_PROCESSOR_COUNT=1
Expand Down
4 changes: 4 additions & 0 deletions images/8.0-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

FROM php:8.0-fpm-bullseye

RUN sed -i -e 's|security.debian.org/debian-security|archive.debian.org/debian-security|g' \
-e 's|deb.debian.org/debian-security|archive.debian.org/debian-security|g' /etc/apt/sources.list \
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99ignore-release-date

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN \
Expand Down
2 changes: 2 additions & 0 deletions images/8.2-apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# docker build -t devwithlando/php:8.2-apache-7 .

FROM php:8.2-apache-bookworm
ARG MIN_PHP=
RUN [ -z "$MIN_PHP" ] || dpkg --compare-versions "$PHP_VERSION" ge "$MIN_PHP" || { echo "PHP $PHP_VERSION < $MIN_PHP"; exit 1; }

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

Expand Down
2 changes: 2 additions & 0 deletions images/8.2-fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# docker build -t devwithlando/php:8.2-fpm-7 .

FROM php:8.2-fpm-bookworm
ARG MIN_PHP=
RUN [ -z "$MIN_PHP" ] || dpkg --compare-versions "$PHP_VERSION" ge "$MIN_PHP" || { echo "PHP $PHP_VERSION < $MIN_PHP"; exit 1; }

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

Expand Down
2 changes: 2 additions & 0 deletions images/8.3-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FROM mysql:8.0 AS mysql-client-80
FROM mysql:8.4 AS mysql-client-84

FROM php:8.3-apache-trixie
ARG MIN_PHP=
RUN [ -z "$MIN_PHP" ] || dpkg --compare-versions "$PHP_VERSION" ge "$MIN_PHP" || { echo "PHP $PHP_VERSION < $MIN_PHP"; exit 1; }

ARG TARGETARCH

Expand Down
2 changes: 2 additions & 0 deletions images/8.3-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FROM mysql:8.0 AS mysql-client-80
FROM mysql:8.4 AS mysql-client-84

FROM php:8.3-fpm-trixie
ARG MIN_PHP=
RUN [ -z "$MIN_PHP" ] || dpkg --compare-versions "$PHP_VERSION" ge "$MIN_PHP" || { echo "PHP $PHP_VERSION < $MIN_PHP"; exit 1; }

ARG TARGETARCH

Expand Down
2 changes: 2 additions & 0 deletions images/8.4-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FROM mysql:8.0 AS mysql-client-80
FROM mysql:8.4 AS mysql-client-84

FROM php:8.4-apache-trixie
ARG MIN_PHP=
RUN [ -z "$MIN_PHP" ] || dpkg --compare-versions "$PHP_VERSION" ge "$MIN_PHP" || { echo "PHP $PHP_VERSION < $MIN_PHP"; exit 1; }

ARG TARGETARCH

Expand Down
2 changes: 2 additions & 0 deletions images/8.4-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FROM mysql:8.0 AS mysql-client-80
FROM mysql:8.4 AS mysql-client-84

FROM php:8.4-fpm-trixie
ARG MIN_PHP=
RUN [ -z "$MIN_PHP" ] || dpkg --compare-versions "$PHP_VERSION" ge "$MIN_PHP" || { echo "PHP $PHP_VERSION < $MIN_PHP"; exit 1; }

ARG TARGETARCH

Expand Down
2 changes: 2 additions & 0 deletions images/8.5-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FROM mysql:8.0 AS mysql-client-80
FROM mysql:8.4 AS mysql-client-84

FROM php:8.5-apache-trixie
ARG MIN_PHP=
RUN [ -z "$MIN_PHP" ] || dpkg --compare-versions "$PHP_VERSION" ge "$MIN_PHP" || { echo "PHP $PHP_VERSION < $MIN_PHP"; exit 1; }

ARG TARGETARCH

Expand Down
2 changes: 2 additions & 0 deletions images/8.5-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FROM mysql:8.0 AS mysql-client-80
FROM mysql:8.4 AS mysql-client-84

FROM php:8.5-fpm-trixie
ARG MIN_PHP=
RUN [ -z "$MIN_PHP" ] || dpkg --compare-versions "$PHP_VERSION" ge "$MIN_PHP" || { echo "PHP $PHP_VERSION < $MIN_PHP"; exit 1; }

ARG TARGETARCH

Expand Down
Loading