diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml
index 7d56dea..8112e74 100644
--- a/.github/workflows/docker-build.yaml
+++ b/.github/workflows/docker-build.yaml
@@ -17,86 +17,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- include:
- - name: php74
- folder: php/7.4
- arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
- targets:
- primary:
- name: cli
- tags: phpdockerio/php:7.4-cli,phpdockerio/php74-cli:latest
- secondary:
- name: fpm
- tags: phpdockerio/php:7.4-fpm,phpdockerio/php74-fpm:latest
- tertiary:
- name: swoole
- tags: phpdockerio/php74-swoole:latest
-
- - name: php80
- folder: php/8.0
- arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
- targets:
- primary:
- name: cli
- tags: phpdockerio/php:8.0-cli,phpdockerio/php80-cli:latest
- secondary:
- name: fpm
- tags: phpdockerio/php:8.0-fpm,phpdockerio/php80-fpm:latest
- tertiary:
- name: swoole
- tags: phpdockerio/php80-swoole:latest
-
- - name: php81
- folder: php/8.1
- arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
- targets:
- primary:
- name: cli
- tags: phpdockerio/php:8.1-cli
- secondary:
- name: fpm
- tags: phpdockerio/php:8.1-fpm
- tertiary: ~
-
- - name: php82
- folder: php/8.2
- arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
- targets:
- primary:
- name: cli
- tags: phpdockerio/php:8.2-cli
- secondary:
- name: fpm
- tags: phpdockerio/php:8.2-fpm
- tertiary: ~
-
- - name: php83
- folder: php/8.3
- arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
- targets:
- primary:
- name: cli
- tags: phpdockerio/php:8.3-cli
- secondary:
- name: fpm
- tags: phpdockerio/php:8.3-fpm
- tertiary: ~
-
- - name: php84
- folder: php/8.4
- arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
- targets:
- primary:
- name: cli
- tags: phpdockerio/php:8.4-cli
- secondary:
- name: fpm
- tags: phpdockerio/php:8.4-fpm
- tertiary: ~
+ php: [ '8.1', '8.2', '8.3', '8.4' ]
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
- name: Debug
run: |
@@ -116,34 +41,28 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Primary container
- uses: docker/build-push-action@v6
- with:
- context: ${{ matrix.folder }}
- platforms: ${{ join(matrix.arch, ',') }}
- push: ${{ github.ref == 'refs/heads/master' }}
- pull: true
- tags: ${{ matrix.targets.primary.tags }}
- target: ${{ matrix.targets.primary.name }}
-
- - name: Secondary container
- if: matrix.targets.secondary
+ - name: PHP CLI container
uses: docker/build-push-action@v6
with:
- context: ${{ matrix.folder }}
- platforms: ${{ join(matrix.arch, ',') }}
+ context: php/${{ matrix.php }}
+ platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.ref == 'refs/heads/master' }}
pull: true
- tags: ${{ matrix.targets.secondary.tags }}
- target: ${{ matrix.targets.secondary.name }}
+ # Enable BuildKit cache restore/save across workflow runs
+ cache-from: type=gha,scope=php-${{ matrix.php }}
+ cache-to: type=gha,mode=max,scope=php-${{ matrix.php }}
+ tags: phpdockerio/php:${{ matrix.php }}-cli
+ target: cli
- - name: Tertiary container
- if: matrix.targets.tertiary
+ - name: PHP FPM container
uses: docker/build-push-action@v6
with:
- context: ${{ matrix.folder }}
- platforms: ${{ join(matrix.arch, ',') }}
+ context: php/${{ matrix.php }}
+ platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.ref == 'refs/heads/master' }}
pull: true
- tags: ${{ matrix.targets.tertiary.tags }}
- target: ${{ matrix.targets.tertiary.name }}
+ # Enable BuildKit cache restore/save across workflow runs
+ cache-from: type=gha,scope=php-${{ matrix.php }}
+ cache-to: type=gha,mode=max,scope=php-${{ matrix.php }}
+ tags: phpdockerio/php:${{ matrix.php }}-fpm
+ target: fpm
diff --git a/README.md b/README.md
index 0f042b2..745feb2 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,9 @@
# PHPDocker.io base images
-Repository of base images for [PHPDocker.io](http://phpdocker.io) generated environments.
+Repository of base images for [PHPDocker.io](http://phpdocker.io)-generated environments.
-Images are [built daily](https://github.com/phpdocker-io/base-images/actions/workflows/docker-build.yaml) in order to
-fetch the latest base image changes as well as available php versions.
+Images are [built daily](https://github.com/phpdocker-io/base-images/actions/workflows/docker-build.yaml) to pick up the
+latest base image updates as well as available PHP versions.
## PHP
@@ -13,47 +13,40 @@ fetch the latest base image changes as well as available php versions.
* `linux/arm64`
* `linux/arm/v7`
-### OS Base images & PHP Package Sources
+### OS base images and PHP package sources
-All images use an Ubuntu LTS release as base image, except for PHP5.6 which uses Debian Jessie. For each of these base
-OS images, we use a third party source for the PHP packages - these packages come from
-[Ondřej Surý](https://github.com/oerdnj/deb.sury.org) who is the official maintainer for PHP in Debian which is the
-origin of all packages in Ubuntu.
+All images use an Ubuntu LTS release as the base image. For each of these base OS images, we use a third-party source
+for the PHP packages. These packages come from [Ondřej Surý](https://github.com/oerdnj/deb.sury.org), the official
+maintainer for PHP in Debian (which is the upstream for Ubuntu’s packages).
-In most cases, we override Ubuntu's PHP packages with Ondřej's to ensure we always have the very latest. For instance,
-Ubuntu 20.04 comes with php 7.4.3 but we still install Ondřej's packages to ensure you get the absolutest latest version
-of php 7.4 every time. Ubuntu backport security fixes, but not necessarily bugfixes from later patch releases.
+In most cases, we override Ubuntu's PHP packages with Ondřej's to ensure you always get the latest. For instance,
+Ubuntu 24.04 comes with PHP 8.3.6, but we still install Ondřej's packages so you receive the latest PHP 7.4 patch
+release every time. Ubuntu backports security fixes, but not necessarily bug fixes from later patch releases.
### Image types
-For each minor PHP version (`MAJOR.MINOR`) we have a `cli` and an `fpm` variant. These two are identical, except for the
-fact the `fpm` contains `php-fpm` and their default command is of course `php-fpm`.
+For each minor PHP version (`MAJOR.MINOR`) we provide a `cli` and an `fpm` variant. These two are identical, except that
+`fpm` includes `php-fpm`, and the default command is of course `php-fpm`.
-The images do not define an `ENTRYPOINT`, instead they define a `CMD` - this is to make it easier for you to define your
-own entrypoint that does stuff before running the `CMD`.
+The images do not define an `ENTRYPOINT`; instead, they define a `CMD`. This makes it easier to provide your own
+entrypoint that does some setup before running the `CMD`.
-#### Note on `swoole` variants
-We also used to offer a `swoole` variant on some images. We have phased these out, as the images were created before we
-could reliably install the extension via `apt` and we had to compile it from source. It is now available as an
-`apt` package and all you need to do is install it.
-
-### Built-in php extensions
+### Built-in PHP extensions
* apcu & apcu-bc
* curl
-* json (from 8.0, part of php core)
* mbstring
* opcache
* readline
* xml
* zip
-These are the minimum extensions I consider necessary for any modern PHP app. They're required by the likes
-of `composer`, the `symfony/*` libraries etc.
+These are the minimum extensions I consider necessary for any modern PHP app. They're required by the likes of
+`Composer`, the `symfony/*` libraries, etc.
### Composer
-All images use the composer v2. If for whatever reason you need to roll back to v1, add the following to your Dockerfile
+All images use Composer v2. If, for whatever reason, you need to roll back to v1, add the following to your Dockerfile:
```Dockerfile
COPY --from=composer:1 /usr/bin/composer /usr/bin/composer
@@ -61,28 +54,26 @@ COPY --from=composer:1 /usr/bin/composer /usr/bin/composer
### Available images:
-**Notes:**
-
| PHP
version | Images | OS base | PHP EOL date | Daily builds |
|------------------|----------------------------------------------------------|---------------|---------------|--------------|
-| 8.4 | `phpdockerio/php:8.4-cli`
`phpdockerio/php:8.4-fpm` | Ubuntu 24.04 | ✔ 31 Nov 2028 | ✔ |
-| 8.3 | `phpdockerio/php:8.3-cli`
`phpdockerio/php:8.3-fpm` | Ubuntu 22.04 | ✔ 31 Nov 2027 | ✔ |
+| 8.4 | `phpdockerio/php:8.4-cli`
`phpdockerio/php:8.4-fpm` | Ubuntu 24.04 | ✔ 30 Nov 2028 | ✔ |
+| 8.3 | `phpdockerio/php:8.3-cli`
`phpdockerio/php:8.3-fpm` | Ubuntu 22.04 | ✔ 30 Nov 2027 | ✔ |
| 8.2 | `phpdockerio/php:8.2-cli`
`phpdockerio/php:8.2-fpm` | Ubuntu 22.04 | ✔ 31 Dec 2026 | ✔ |
| 8.1 | `phpdockerio/php:8.1-cli`
`phpdockerio/php:8.1-fpm` | Ubuntu 22.04 | ✔ 31 Dec 2025 | ✔ |
-| 8.0 | `phpdockerio/php:8.0-cli`
`phpdockerio/php:8.0-fpm` | Ubuntu 20.04 | ❌ 26 Nov 2023 | ✔ |
-| 7.4 | `phpdockerio/php:7.4-cli`
`phpdockerio/php:7.4-fpm` | Ubuntu 20.04 | ❌ 28 Nov 2022 | ✔ |
-| 7.3 | `phpdockerio/php73-cli`
`phpdockerio/php73-cli` | Ubuntu 18.04 | ❌ 06 Dec 2021 | ❌ |
-| 7.2 | `phpdockerio/php72-cli`
`phpdockerio/php72-cli` | Ubuntu 18.04 | ❌ 30 Nov 2020 | ❌ |
+| 8.0 | `phpdockerio/php:8.0-cli`
`phpdockerio/php:8.0-fpm` | Ubuntu 20.04 | ❌ 26 Nov 2023 | ❌ |
+| 7.4 | `phpdockerio/php:7.4-cli`
`phpdockerio/php:7.4-fpm` | Ubuntu 20.04 | ❌ 28 Nov 2022 | ❌ |
+| 7.3 | `phpdockerio/php73-cli`
`phpdockerio/php73-fpm` | Ubuntu 18.04 | ❌ 06 Dec 2021 | ❌ |
+| 7.2 | `phpdockerio/php72-cli`
`phpdockerio/php72-fpm` | Ubuntu 18.04 | ❌ 30 Nov 2020 | ❌ |
| 7.1 | `phpdockerio/php71-cli`
`phpdockerio/php71-fpm` | Ubuntu 16.04 | ❌ 01 Dec 2019 | ❌ |
| 7.0 | `phpdockerio/php70-cli`
`phpdockerio/php70-fpm` | Ubuntu 16.04 | ❌ 10 Jan 2019 | ❌ |
| 5.6 | `phpdockerio/php56-cli`
`phpdockerio/php56-fpm` | Debian Jessie | ❌ 31 Dec 2018 | ❌ |
-* Versions past EOL (end of life) are unsupported, but may still get daily builds to ensure the underlying OS packages
+* Versions past EOL (end of life) are unsupported but may still get daily builds to ensure the underlying OS packages
are up to date.
* Daily builds are turned off for versions that run on an OS base that's also EOL (for instance, Ubuntu 18.04).
-* Daily builds are kept for PHP versions that have reached EOL but the base OS has not - the base OS still receives
- security updates.
-* In general, do not use any unsupported images in a production environment, regardless of whether daily builds are
- still enabled. I continue to build these for absolute holdouts that haven't been able to upgrade on time.
-* Old images are kept in docker hub in the interest of enabling legacy apps to run. Docker does delete images that
- haven't been accessed for 6 months. If this happens, I won't be restoring them - you'll need to upgrade.
+* Daily builds are kept for PHP versions that have reached EOL while the base OS has not, because the base OS still
+ receives security updates.
+* In general, do not use unsupported images in a production environment, regardless of whether daily builds are still
+ enabled. I continue to build these for absolute holdouts that haven't been able to upgrade on time.
+* Old images are kept in Docker Hub to enable legacy apps to run. Docker Hub deletes images that haven't been accessed
+ for 6 months. If this happens, I won't be restoring them — you'll need to upgrade.
diff --git a/php/7.4/Dockerfile b/php/7.4/Dockerfile
deleted file mode 100644
index a8996a6..0000000
--- a/php/7.4/Dockerfile
+++ /dev/null
@@ -1,70 +0,0 @@
-###########################################
-# PHPDocker.io PHP 7.4 / CLI & FPM images #
-###########################################
-
-FROM ubuntu:focal AS cli
-
-# Fixes some weird terminal issues such as broken clear / CTRL+L
-ENV TERM=linux
-
-# Ensure apt doesn't ask questions when installing stuff
-ENV DEBIAN_FRONTEND=noninteractive
-
-# Install Ondrej repos for Ubuntu focal, PHP7.4, composer and selected extensions - better selection than
-# the distro's packages
-RUN apt-get update \
- && apt-get install -y --no-install-recommends gnupg \
- && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
- && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
- && apt-get update \
- && apt-get -y --no-install-recommends install \
- ca-certificates \
- curl \
- unzip \
- php7.4-apcu \
- php7.4-apcu-bc \
- php7.4-cli \
- php7.4-curl \
- php7.4-json \
- php7.4-mbstring \
- php7.4-opcache \
- php7.4-readline \
- php7.4-xml \
- php7.4-zip \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
-
-COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
-
-CMD ["php", "-a"]
-
-# If you'd like to be able to use this container on a docker-compose environment as a quiescent PHP CLI container
-# you can /bin/bash into, override CMD with the following - bear in mind that this will make docker-compose stop
-# slow on such a container, docker-compose kill might do if you're in a hurry
-# CMD ["tail", "-f", "/dev/null"]
-
-FROM cli AS fpm
-
-# Install FPM
-RUN apt-get update \
- && apt-get -y --no-install-recommends install php7.4-fpm \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
-
-STOPSIGNAL SIGQUIT
-
-# PHP-FPM packages need a nudge to make them docker-friendly
-COPY overrides.conf /etc/php/7.4/fpm/pool.d/z-overrides.conf
-
-CMD ["/usr/sbin/php-fpm7.4", "-O" ]
-
-# Open up fcgi port
-EXPOSE 9000
-
-FROM cli AS swoole
-
-# Install the latest available published swoole release
-RUN apt-get update \
- && apt-get -y --no-install-recommends install php7.4-swoole \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
diff --git a/php/7.4/README.md b/php/7.4/README.md
deleted file mode 100644
index 2b091d5..0000000
--- a/php/7.4/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# PHPDocker.io - PHP 7.4 / CLI, FPM and Swoole container images
-
-Ubuntu 18.04 PHP 7.4 CLI and FPM container images for [PHPDocker.io](http://phpdocker.io) projects. Packages are provided by [Ondřej Surý](https://deb.sury.org/).
-
-Far smaller in size than PHP's official container. No need to compile any extensions: simply run `apt-get install php7.4-EXTENSION_NAME` as part of your Dockerfile
-
-*Note on logging:* configure your application to stream logs into `php://stdout`. That's it.
-
-## About swoole
-
-Swoole version is not configurable. We always provide the latest available via Ondrej's PPA to this version of PHP.
-
-### Usage
-
-First, configure your swoole front controller, take note of the port you're starting the server on. For instance:
-
-```php
-on("start", function ($server) {
- echo "Swoole http server is started at http://127.0.0.1:8101\n";
-});
-
-$http->on("request", function ($request, $response) {
- $response->header("Content-Type", "text/plain");
- $response->end("Hello World\n");
-});
-
-$http->start();
-```
-
-Second, run the container:
-
-```bash
-docker run --rm -t -p 8101:8101 -v $(pwd):/app phpdockerio/php74-swoole php /app/index.php
-```
diff --git a/php/7.4/overrides.conf b/php/7.4/overrides.conf
deleted file mode 100644
index e1c0646..0000000
--- a/php/7.4/overrides.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-[global]
-; Override default pid file
-pid = /run/php-fpm.pid
-
-; Avoid logs being sent to syslog
-error_log = /proc/self/fd/2
-
-; Set this to php default's max_execution_time to allow children to stop gracefully when fpm is commanded to stop
-; This helps avoiding 502's
-process_control_timeout = 30
-
-; Do not daemonize (eg send process to the background)
-daemonize = no
-
-[www]
-; Access from webserver container is via network, not socket file
-listen = [::]:9000
-
-; Redirect logs to stdout - FPM closes /dev/std* on startup
-access.log = /proc/self/fd/2
-catch_workers_output = yes
-
-; Remove "pool www" decoration from log output (older phpdocker.io containers for php use sed for this)
-decorate_workers_output = no
-
-; Required to allow config-by-environment
-clear_env = no
diff --git a/php/8.0/Dockerfile b/php/8.0/Dockerfile
deleted file mode 100644
index 264509a..0000000
--- a/php/8.0/Dockerfile
+++ /dev/null
@@ -1,68 +0,0 @@
-##################################################
-# PHPDocker.io PHP 8.0 / CLI, FPM & Swoole image #
-##################################################
-
-FROM ubuntu:focal AS cli
-
-# Fixes some weird terminal issues such as broken clear / CTRL+L
-ENV TERM=linux
-
-# Ensure apt doesn't ask questions when installing stuff
-ENV DEBIAN_FRONTEND=noninteractive
-
-# Install Ondrej repos for Ubuntu focal, PHP8.0, composer and selected extensions - better selection than
-# the distro's packages
-RUN apt-get update \
- && apt-get install -y --no-install-recommends gnupg \
- && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
- && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
- && apt-get update \
- && apt-get -y --no-install-recommends install \
- ca-certificates \
- curl \
- unzip \
- php8.0-apcu \
- php8.0-cli \
- php8.0-curl \
- php8.0-mbstring \
- php8.0-opcache \
- php8.0-readline \
- php8.0-xml \
- php8.0-zip \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* ~/.composer
-
-COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
-
-CMD ["php", "-a"]
-
-# If you'd like to be able to use this container on a docker-compose environment as a quiescent PHP CLI container
-# you can /bin/bash into, override CMD with the following - bear in mind that this will make docker-compose stop
-# slow on such a container, docker-compose kill might do if you're in a hurry
-# CMD ["tail", "-f", "/dev/null"]
-
-FROM cli AS fpm
-
-# Install FPM
-RUN apt-get update \
- && apt-get -y --no-install-recommends install php8.0-fpm \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
-
-STOPSIGNAL SIGQUIT
-
-# PHP-FPM packages need a nudge to make them docker-friendly
-COPY overrides.conf /etc/php/8.0/fpm/pool.d/z-overrides.conf
-
-CMD ["/usr/sbin/php-fpm8.0", "-O" ]
-
-# Open up fcgi port
-EXPOSE 9000
-
-FROM cli AS swoole
-
-# Install the latest available published swoole release
-RUN apt-get update \
- && apt-get -y --no-install-recommends install php8.0-swoole \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
diff --git a/php/8.0/README.md b/php/8.0/README.md
deleted file mode 100644
index 7b7c0fc..0000000
--- a/php/8.0/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# PHPDocker.io - PHP 8.0 / CLI, FPM and Swoole container images
-
-Ubuntu 20.04 PHP 8.0 CLI and FPM container images for [PHPDocker.io](http://phpdocker.io) projects. Packages are provided by [Ondřej Surý](https://deb.sury.org/).
-
-Far smaller in size than PHP's official container. No need to compile any extensions: simply run `apt-get install php8.0-EXTENSION_NAME` as part of your Dockerfile
-
-*Note on logging:* configure your application to stream logs into `php://stdout`. That's it.
-
-## About swoole
-
-Swoole version is not configurable. We always provide the latest available via Ondrej's PPA to this version of PHP.
-
-### Usage
-
-First, configure your swoole front controller, take note of the port you're starting the server on. For instance:
-
-```php
-on("start", function ($server) {
- echo "Swoole http server is started at http://127.0.0.1:8101\n";
-});
-
-$http->on("request", function ($request, $response) {
- $response->header("Content-Type", "text/plain");
- $response->end("Hello World\n");
-});
-
-$http->start();
-```
-
-Second, run the container:
-
-```bash
-docker run --rm -t -p 8101:8101 -v $(pwd):/app phpdockerio/php80-swoole php /app/index.php
-```
diff --git a/php/8.0/overrides.conf b/php/8.0/overrides.conf
deleted file mode 100644
index e1c0646..0000000
--- a/php/8.0/overrides.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-[global]
-; Override default pid file
-pid = /run/php-fpm.pid
-
-; Avoid logs being sent to syslog
-error_log = /proc/self/fd/2
-
-; Set this to php default's max_execution_time to allow children to stop gracefully when fpm is commanded to stop
-; This helps avoiding 502's
-process_control_timeout = 30
-
-; Do not daemonize (eg send process to the background)
-daemonize = no
-
-[www]
-; Access from webserver container is via network, not socket file
-listen = [::]:9000
-
-; Redirect logs to stdout - FPM closes /dev/std* on startup
-access.log = /proc/self/fd/2
-catch_workers_output = yes
-
-; Remove "pool www" decoration from log output (older phpdocker.io containers for php use sed for this)
-decorate_workers_output = no
-
-; Required to allow config-by-environment
-clear_env = no