Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
55c03c5
Disable warning about secrets because they don't have any secrets to …
jaydrogers Aug 19, 2025
d344d53
Add "Professionally Supported" section to README with service options…
jaydrogers Aug 20, 2025
e4ff084
Add script to fetch latest NGINX versions for different operating sys…
jaydrogers Aug 21, 2025
a20fc49
Update view-nginx-versions.sh script comments for clarity on OS filte…
jaydrogers Aug 21, 2025
831e272
Update view-nginx-versions.sh help menu to clarify source of NGINX ve…
jaydrogers Aug 21, 2025
1781743
Add functionality to determine and add family alias tags for Docker i…
jaydrogers Aug 21, 2025
7a7fc6b
Add auto-resolution for NGINX version in dev.sh for fpm-nginx builds.…
jaydrogers Aug 21, 2025
99d7bd4
Update NGINX version for Alpine 3.17 to 1.26.2-r1 and ensure proper f…
jaydrogers Aug 21, 2025
e9d3bb8
Renamed NGINX script and added --write mode
jaydrogers Aug 21, 2025
a390206
Add documentation for NGINX version management, including commands to…
jaydrogers Aug 21, 2025
5666893
Refactor to support installing NGINX from a specific version from the…
jaydrogers Aug 21, 2025
83761e2
Add NGINX repository key verification details for Debian and Alpine, …
jaydrogers Aug 21, 2025
85b4543
Update NGINX directory paths in docker-php-serversideup-set-file-perm…
jaydrogers Aug 21, 2025
238e208
Add dockerhub validation
jaydrogers Aug 21, 2025
0f41cca
Implement NGINX version computation for fpm-nginx builds in Docker wo…
jaydrogers Aug 21, 2025
6e1703a
Added Depot CI runners
jaydrogers Aug 21, 2025
a711abb
Adjust filtering logic to supported "latest OS" within the "supported…
jaydrogers Aug 21, 2025
304c527
Move matrix generation to a script
jaydrogers Aug 21, 2025
b015a35
Remove Trixie support for Unit
jaydrogers Aug 21, 2025
4f7d9fa
Remove support for Alpine 3.20 in PHP 8.4
jaydrogers Aug 21, 2025
c0e0f82
Removed Alpine 3.20
jaydrogers Aug 21, 2025
306bf0c
Added trixie support to Unit
jaydrogers Aug 21, 2025
9fefa9b
Add validation for OS and variation in Docker tag assembly script; in…
jaydrogers Aug 21, 2025
9467a3c
Enhance version weighting logic in matrix generation script to suppor…
jaydrogers Aug 21, 2025
ae3a912
Changed matrix to depot runner
jaydrogers Aug 21, 2025
141deb0
Update PHP extension installer version to 2.9.4
jaydrogers Aug 21, 2025
6642364
Update php-fpm-healthcheck to version 0.6.0 in installation script
jaydrogers Aug 21, 2025
e52ae67
Update S6 version to 3.2.1.0 in installation script
jaydrogers Aug 21, 2025
57340cc
Update NGINX Unit version to 1.34.2 in Dockerfile
jaydrogers Aug 21, 2025
6aade3e
Update php-fpm-healthcheck to version 0.6.0 in Dockerfile
jaydrogers Aug 21, 2025
74670a8
Comment out PHP 8.5-rc configuration due to a blocking bug in a depen…
jaydrogers Aug 21, 2025
26c1f6f
Organized script for better readability
jaydrogers Aug 21, 2025
a3a11f8
Enhance script to require root privileges and improve error handling …
jaydrogers Aug 21, 2025
fea1f34
Fix Joel's Twitter 😃
jaydrogers Aug 25, 2025
1af1689
Updated X links
jaydrogers Aug 25, 2025
3a99dd9
Updated even more X links
jaydrogers Aug 25, 2025
b3947ae
Added clarity
jaydrogers Aug 25, 2025
98f45d5
Add special infrastructure sponsors section to README.md
jaydrogers Aug 25, 2025
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
30 changes: 19 additions & 11 deletions .github/workflows/service_docker-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:

jobs:
setup-matrix:
runs-on: ubuntu-24.04
runs-on: depot-ubuntu-24.04
outputs:
php-version-map-json: ${{ steps.get-php-versions.outputs.php-version-map-json }}
steps:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Assemble PHP versions into the matrix. 😎
id: get-php-versions
run: |
MATRIX_JSON=$(yq -o=json scripts/conf/php-versions.yml | jq -c '{include: [(.php_variations[] | {name, supported_os: (.supported_os // ["alpine", "bullseye", "bookworm"])} ) as $variation | .php_versions[] | .minor_versions[] | .patch_versions[] as $patch | .base_os[] as $os | select($variation.supported_os | if length == 0 then . else . | index($os.name) end) | {patch_version: $patch, base_os: $os.name, php_variation: $variation.name}]} | {include: (.include | sort_by(.patch_version | split(".") | map(tonumber) | . as $nums | ($nums[0]*10000 + $nums[1]*100 + $nums[2])) | reverse)}')
MATRIX_JSON=$(bash ./scripts/generate-matrix.sh '${{ inputs.php-versions-file }}')
echo "php-version-map-json=${MATRIX_JSON}" >> $GITHUB_OUTPUT
echo "${MATRIX_JSON}" | jq '.'

Expand All @@ -78,12 +78,7 @@ jobs:

docker-publish:
needs: setup-matrix
runs-on: ubuntu-24.04
## Use AWS runners
# runs-on:
# - runs-on
# - runner=4cpu-linux-x64
# - run-id=${{ github.run_id }}
runs-on: depot-ubuntu-24.04-4
strategy:
matrix: ${{fromJson(needs.setup-matrix.outputs.php-version-map-json)}}

Expand Down Expand Up @@ -161,20 +156,33 @@ jobs:
echo "REPOSITORY_BUILD_VERSION=git-${SHORT_SHA}-${{ github.run_id }}" >> $GITHUB_ENV
fi

- name: Compute NGINX build-arg (only for fpm-nginx)
id: compute_nginx
if: ${{ matrix.php_variation == 'fpm-nginx' }}
run: |
if command -v yq >/dev/null 2>&1; then
VERSION=$(yq -r '.operating_systems[].versions[] | select(.version == "${{ matrix.base_os }}") | .nginx_version' '${{ inputs.php-versions-file }}' | head -n1)
else
VERSION=$(awk -v key="${{ matrix.base_os }}" 'BEGIN{found=0} $1=="version:" && $2==key {found=1} found && $1=="nginx_version:" {print $2; exit}' "${{ inputs.php-versions-file }}")
fi
if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then
echo "Unable to determine NGINX version for OS ${{ matrix.base_os }}" 1>&2
exit 1
fi
echo "nginx_arg=NGINX_VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Build images
uses: docker/build-push-action@v6
with:
file: src/variations/${{ matrix.php_variation }}/Dockerfile
cache-from: type=gha
cache-to: type=gha
## Run-on cache
# cache-from: type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }}
# cache-to: type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max
build-args: |
BASE_OS_VERSION=${{ matrix.base_os }}
PHP_VERSION=${{ matrix.patch_version }}
PHP_VARIATION=${{ matrix.php_variation }}
REPOSITORY_BUILD_VERSION=${{ env.REPOSITORY_BUILD_VERSION }}
${{ steps.compute_nginx.outputs.nginx_arg }}
platforms: |
linux/amd64
linux/arm64/v8
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ Experience the ***true difference*** of using these images vs the other options

</details>

## Professionally Supported
Are you looking for help on integreating Docker with your PHP application? We have multiple options to help your team out:

- [Get Managed Hosting](https://serversideup.net/hire-us/): CI/CD design and engineering, managed hosting, guaranteed uptime, any host, any server.
- [Get Professional Help](https://schedule.serversideup.net/team/serversideup/quick-chat-with-jay): Get video + screen-sharing help directly from the core contributors.
- [Get a Full-Stack Development Team](https://serversideup.net/hire-us/): We can build your app from the ground up, or help you with your existing codebase.

## Usage
This repository creates a number of Docker image variations, allowing you to choose exactly what you need.

Expand Down Expand Up @@ -85,25 +92,30 @@ All of our software is free an open to the world. None of this can be brought to
#### Bronze Sponsors
<!-- bronze -->No bronze sponsors yet. <a href="https://github.com/sponsors/serversideup">Become a sponsor →</a><!-- bronze -->

#### Special Infrastructure Sponsors
This project takes an incredible amount of computing power to build and maintain over 8,000 different docker image tags. We're extremely grateful for the following sponsors who help bring the power to ship more PHP.

<a href="https://depot.dev/"><img src="https://serversideup.net/sponsors/depot.png" alt="Depot" width="250px"></a>&nbsp;&nbsp;<a href="https://hub.docker.com/u/serversideup"><img src="https://serversideup.net/sponsors/docker.png" alt="Docker" width="250px"></a>

#### Individual Supporters
<!-- supporters --><a href="https://github.com/GeekDougle"><img src="https://github.com/GeekDougle.png" width="40px" alt="GeekDougle" /></a>&nbsp;&nbsp;<a href="https://github.com/JQuilty"><img src="https://github.com/JQuilty.png" width="40px" alt="JQuilty" /></a>&nbsp;&nbsp;<a href="https://github.com/MaltMethodDev"><img src="https://github.com/MaltMethodDev.png" width="40px" alt="MaltMethodDev" /></a>&nbsp;&nbsp;<a href="https://github.com/bananabrann"><img src="https://github.com/bananabrann.png" width="40px" alt="bananabrann" /></a>&nbsp;&nbsp;<!-- supporters -->

#### Special thanks
We'd like to specifically thank a few folks for taking the time for being a sound board that deeply influenced the direction of this project.

Please check out all of their work:
- [Chris Fidao](https://twitter.com/fideloper)
- [Joel Clermont](https://twitter.com/joelclermont)
- [Patricio](https://twitter.com/PatricioOnCode)
Please check out their work:
- [Chris Fidao](https://x.com/fideloper)
- [Joel Clermont](https://x.com/jclermont)
- [Patricio](https://x.com/PatricioOnCode)

## About Us
We're [Dan](https://twitter.com/danpastori) and [Jay](https://twitter.com/jaydrogers) - a two person team with a passion for open source products. We created [Server Side Up](https://serversideup.net) to help share what we learn.
We're [Dan](https://x.com/danpastori) and [Jay](https://x.com/jaydrogers) - a two person team with a passion for open source products. We created [Server Side Up](https://serversideup.net) to help share what we learn.

<div align="center">

| <div align="center">Dan Pastori</div> | <div align="center">Jay Rogers</div> |
| ----------------------------- | ------------------------------------------ |
| <div align="center"><a href="https://twitter.com/danpastori"><img src="https://serversideup.net/wp-content/uploads/2023/08/dan.jpg" title="Dan Pastori" width="150px"></a><br /><a href="https://twitter.com/danpastori"><img src="https://serversideup.net/wp-content/themes/serversideup/images/open-source/twitter.svg" title="Twitter" width="24px"></a><a href="https://github.com/danpastori"><img src="https://serversideup.net/wp-content/themes/serversideup/images/open-source/github.svg" title="GitHub" width="24px"></a></div> | <div align="center"><a href="https://twitter.com/jaydrogers"><img src="https://serversideup.net/wp-content/uploads/2023/08/jay.jpg" title="Jay Rogers" width="150px"></a><br /><a href="https://twitter.com/jaydrogers"><img src="https://serversideup.net/wp-content/themes/serversideup/images/open-source/twitter.svg" title="Twitter" width="24px"></a><a href="https://github.com/jaydrogers"><img src="https://serversideup.net/wp-content/themes/serversideup/images/open-source/github.svg" title="GitHub" width="24px"></a></div> |
| <div align="center"><a href="https://x.com/danpastori"><img src="https://serversideup.net/wp-content/uploads/2023/08/dan.jpg" title="Dan Pastori" width="150px"></a><br /><a href="https://x.com/danpastori"><img src="https://serversideup.net/wp-content/themes/serversideup/images/open-source/twitter.svg" title="Twitter" width="24px"></a><a href="https://github.com/danpastori"><img src="https://serversideup.net/wp-content/themes/serversideup/images/open-source/github.svg" title="GitHub" width="24px"></a></div> | <div align="center"><a href="https://x.com/jaydrogers"><img src="https://serversideup.net/wp-content/uploads/2023/08/jay.jpg" title="Jay Rogers" width="150px"></a><br /><a href="https://x.com/jaydrogers"><img src="https://serversideup.net/wp-content/themes/serversideup/images/open-source/twitter.svg" title="Twitter" width="24px"></a><a href="https://github.com/jaydrogers"><img src="https://serversideup.net/wp-content/themes/serversideup/images/open-source/github.svg" title="GitHub" width="24px"></a></div> |

</div>

Expand All @@ -114,7 +126,7 @@ We're [Dan](https://twitter.com/danpastori) and [Jay](https://twitter.com/jaydro
* **🤵‍♂️ [Get Professional Help](https://serversideup.net/professional-support)** - Get video + screen-sharing support from the core contributors.
* **💻 [GitHub](https://github.com/serversideup)** - Check out our other open source projects.
* **📫 [Newsletter](https://serversideup.net/subscribe)** - Skip the algorithms and get quality content right to your inbox.
* **🐥 [Twitter](https://twitter.com/serversideup)** - You can also follow [Dan](https://twitter.com/danpastori) and [Jay](https://twitter.com/jaydrogers).
* **🐥 [Twitter](https://x.com/serversideup)** - You can also follow [Dan](https://x.com/danpastori) and [Jay](https://x.com/jaydrogers).
* **❤️ [Sponsor Us](https://github.com/sponsors/serversideup)** - Please consider sponsoring us so we can create more helpful resources.

## Our products
Expand Down
58 changes: 58 additions & 0 deletions docs/content/docs/2.getting-started/7.contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,64 @@ We use GitHub Actions exclusively to publish all of our releases. If the image e

See `.github/workflows/action_publish-beta-images.yml` for an example of how we publish our beta images.

## NGINX Versions
We use the official NGINX repos to install the latest version of NGINX for each OS. The version to install is set by a build argument, which is loaded from the `scripts/conf/php-versions-base-config.yml` file.

To view the current NGINX versions, run the following command:

::code-panel
---
label: "View NGINX versions"
---
```bash
./scripts/get-nginx-versions.sh
```
::

This script will look at the official NGINX repos to find the latest version of NGINX for each OS. If you want to update the version, you can run the script with the `--write` flag.

::code-panel
---
label: "Update NGINX versions"
---
```bash
./scripts/get-nginx-versions.sh --write
```
::

### NGINX repository key verification

- **Debian (APT)**: We import the official NGINX GPG key from `https://nginx.org/keys/nginx_signing.key` and verify it against a pinned fingerprint via the `SIGNING_FINGERPRINT` build arg.
- **Alpine (APK)**: APK uses a raw RSA public key (`nginx_signing.rsa.pub`). We verify this key by pinning the SHA‑256 of the DER‑encoded public key via the `SIGNING_ALPINE_RSA_PUB_SHA256` build arg. You can provide multiple comma‑separated hashes to support key rotation.

Compute the Alpine key hash when updating:

```bash
curl -sS https://nginx.org/keys/nginx_signing.rsa.pub -o /tmp/nginx_signing.rsa.pub
# macOS
openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -outform DER 2>/dev/null | shasum -a 256 | awk '{print $1}'
# Linux
openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -outform DER 2>/dev/null | sha256sum | awk '{print $1}'
```

Then build with the new hash (optionally include the old hash during rotation):

```bash
docker build \
--build-arg SIGNING_ALPINE_RSA_PUB_SHA256="<new-hash>,<old-hash>" \
-f src/variations/fpm-nginx/Dockerfile .
```

Reference: [Installing NGINX Open Source → Alpine packages](https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/#prebuilt_alpine).

Why allow multiple hashes? This is optional, but useful during a short rotation window:

- Ensure CI builds across branches/runners succeed while the upstream key change propagates.
- Avoid flakes from CDN/caching delays where some environments still see the old key.
- Let you pre-stage the new value before the official switch, then remove the old afterwards.

If you control all builds centrally and can update quickly, pass a single hash.

## Helping out
If you're really eager to help out, here are a few places to get started:
- Help answer questions on [our GitHub Discussions](https://github.com/serversideup/docker-php/discussions) and [our Discord](https://serversideup.net/discord)
Expand Down
Loading