Skip to content

Commit cb69088

Browse files
authored
Trixie support, NGINX improvements, and CI improvements (#554)
* Disable warning about secrets because they don't have any secrets to be concerned about * Add "Professionally Supported" section to README with service options for Docker and PHP integration * Add script to fetch latest NGINX versions for different operating systems and update configuration file with new OS versions * Update view-nginx-versions.sh script comments for clarity on OS filtering options * Update view-nginx-versions.sh help menu to clarify source of NGINX version information * Add functionality to determine and add family alias tags for Docker images based on the latest OS within the build minor. Update PHP versions configuration to include new base OS versions and variations. * Add auto-resolution for NGINX version in dev.sh for fpm-nginx builds. Ensure yq is installed and validate NGINX version against the PHP versions configuration file. * Update NGINX version for Alpine 3.17 to 1.26.2-r1 and ensure proper formatting for Debian Trixie in php-versions-base-config.yml * Renamed NGINX script and added --write mode * Add documentation for NGINX version management, including commands to view and update versions using the get-nginx-versions.sh script. * Refactor to support installing NGINX from a specific version from the official NGINX repos * Add NGINX repository key verification details for Debian and Alpine, including instructions for hash computation and build arguments for key rotation. * Update NGINX directory paths in docker-php-serversideup-set-file-permissions script to include /var/cache/nginx for improved file permission management. * Add dockerhub validation * Implement NGINX version computation for fpm-nginx builds in Docker workflow, enhancing version resolution using yq or awk. Remove unused AWS runner configuration and cache settings. * Added Depot CI runners * Adjust filtering logic to supported "latest OS" within the "supported OS" filter * Move matrix generation to a script * Remove Trixie support for Unit * Remove support for Alpine 3.20 in PHP 8.4 * Removed Alpine 3.20 * Added trixie support to Unit * Add validation for OS and variation in Docker tag assembly script; include support for PHP 8.5-rc in configuration * Enhance version weighting logic in matrix generation script to support numeric patches and RC minors * Changed matrix to depot runner * Update PHP extension installer version to 2.9.4 * Update php-fpm-healthcheck to version 0.6.0 in installation script * Update S6 version to 3.2.1.0 in installation script * Update NGINX Unit version to 1.34.2 in Dockerfile * Update php-fpm-healthcheck to version 0.6.0 in Dockerfile * Comment out PHP 8.5-rc configuration due to a blocking bug in a dependency (phpredis/phpredis#2688) * Organized script for better readability * Enhance script to require root privileges and improve error handling with 'set -eu' * Fix Joel's Twitter 😃 * Updated X links * Updated even more X links * Added clarity * Add special infrastructure sponsors section to README.md
1 parent ae32ba0 commit cb69088

File tree

16 files changed

+1106
-98
lines changed

16 files changed

+1106
-98
lines changed

.github/workflows/service_docker-build-and-publish.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838

3939
jobs:
4040
setup-matrix:
41-
runs-on: ubuntu-24.04
41+
runs-on: depot-ubuntu-24.04
4242
outputs:
4343
php-version-map-json: ${{ steps.get-php-versions.outputs.php-version-map-json }}
4444
steps:
@@ -66,7 +66,7 @@ jobs:
6666
- name: Assemble PHP versions into the matrix. 😎
6767
id: get-php-versions
6868
run: |
69-
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)}')
69+
MATRIX_JSON=$(bash ./scripts/generate-matrix.sh '${{ inputs.php-versions-file }}')
7070
echo "php-version-map-json=${MATRIX_JSON}" >> $GITHUB_OUTPUT
7171
echo "${MATRIX_JSON}" | jq '.'
7272
@@ -78,12 +78,7 @@ jobs:
7878

7979
docker-publish:
8080
needs: setup-matrix
81-
runs-on: ubuntu-24.04
82-
## Use AWS runners
83-
# runs-on:
84-
# - runs-on
85-
# - runner=4cpu-linux-x64
86-
# - run-id=${{ github.run_id }}
81+
runs-on: depot-ubuntu-24.04-4
8782
strategy:
8883
matrix: ${{fromJson(needs.setup-matrix.outputs.php-version-map-json)}}
8984

@@ -161,20 +156,33 @@ jobs:
161156
echo "REPOSITORY_BUILD_VERSION=git-${SHORT_SHA}-${{ github.run_id }}" >> $GITHUB_ENV
162157
fi
163158
159+
- name: Compute NGINX build-arg (only for fpm-nginx)
160+
id: compute_nginx
161+
if: ${{ matrix.php_variation == 'fpm-nginx' }}
162+
run: |
163+
if command -v yq >/dev/null 2>&1; then
164+
VERSION=$(yq -r '.operating_systems[].versions[] | select(.version == "${{ matrix.base_os }}") | .nginx_version' '${{ inputs.php-versions-file }}' | head -n1)
165+
else
166+
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 }}")
167+
fi
168+
if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then
169+
echo "Unable to determine NGINX version for OS ${{ matrix.base_os }}" 1>&2
170+
exit 1
171+
fi
172+
echo "nginx_arg=NGINX_VERSION=$VERSION" >> $GITHUB_OUTPUT
173+
164174
- name: Build images
165175
uses: docker/build-push-action@v6
166176
with:
167177
file: src/variations/${{ matrix.php_variation }}/Dockerfile
168178
cache-from: type=gha
169179
cache-to: type=gha
170-
## Run-on cache
171-
# 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 }}
172-
# 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
173180
build-args: |
174181
BASE_OS_VERSION=${{ matrix.base_os }}
175182
PHP_VERSION=${{ matrix.patch_version }}
176183
PHP_VARIATION=${{ matrix.php_variation }}
177184
REPOSITORY_BUILD_VERSION=${{ env.REPOSITORY_BUILD_VERSION }}
185+
${{ steps.compute_nginx.outputs.nginx_arg }}
178186
platforms: |
179187
linux/amd64
180188
linux/arm64/v8

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ Experience the ***true difference*** of using these images vs the other options
3131

3232
</details>
3333

34+
## Professionally Supported
35+
Are you looking for help on integreating Docker with your PHP application? We have multiple options to help your team out:
36+
37+
- [Get Managed Hosting](https://serversideup.net/hire-us/): CI/CD design and engineering, managed hosting, guaranteed uptime, any host, any server.
38+
- [Get Professional Help](https://schedule.serversideup.net/team/serversideup/quick-chat-with-jay): Get video + screen-sharing help directly from the core contributors.
39+
- [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.
40+
3441
## Usage
3542
This repository creates a number of Docker image variations, allowing you to choose exactly what you need.
3643

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

95+
#### Special Infrastructure Sponsors
96+
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.
97+
98+
<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>
99+
88100
#### Individual Supporters
89101
<!-- 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 -->
90102

91103
#### Special thanks
92104
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.
93105

94-
Please check out all of their work:
95-
- [Chris Fidao](https://twitter.com/fideloper)
96-
- [Joel Clermont](https://twitter.com/joelclermont)
97-
- [Patricio](https://twitter.com/PatricioOnCode)
106+
Please check out their work:
107+
- [Chris Fidao](https://x.com/fideloper)
108+
- [Joel Clermont](https://x.com/jclermont)
109+
- [Patricio](https://x.com/PatricioOnCode)
98110

99111
## About Us
100-
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.
112+
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.
101113

102114
<div align="center">
103115

104116
| <div align="center">Dan Pastori</div> | <div align="center">Jay Rogers</div> |
105117
| ----------------------------- | ------------------------------------------ |
106-
| <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> |
118+
| <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> |
107119

108120
</div>
109121

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

120132
## Our products

docs/content/docs/2.getting-started/7.contributing.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,64 @@ We use GitHub Actions exclusively to publish all of our releases. If the image e
8585

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

88+
## NGINX Versions
89+
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.
90+
91+
To view the current NGINX versions, run the following command:
92+
93+
::code-panel
94+
---
95+
label: "View NGINX versions"
96+
---
97+
```bash
98+
./scripts/get-nginx-versions.sh
99+
```
100+
::
101+
102+
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.
103+
104+
::code-panel
105+
---
106+
label: "Update NGINX versions"
107+
---
108+
```bash
109+
./scripts/get-nginx-versions.sh --write
110+
```
111+
::
112+
113+
### NGINX repository key verification
114+
115+
- **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.
116+
- **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.
117+
118+
Compute the Alpine key hash when updating:
119+
120+
```bash
121+
curl -sS https://nginx.org/keys/nginx_signing.rsa.pub -o /tmp/nginx_signing.rsa.pub
122+
# macOS
123+
openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -outform DER 2>/dev/null | shasum -a 256 | awk '{print $1}'
124+
# Linux
125+
openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -outform DER 2>/dev/null | sha256sum | awk '{print $1}'
126+
```
127+
128+
Then build with the new hash (optionally include the old hash during rotation):
129+
130+
```bash
131+
docker build \
132+
--build-arg SIGNING_ALPINE_RSA_PUB_SHA256="<new-hash>,<old-hash>" \
133+
-f src/variations/fpm-nginx/Dockerfile .
134+
```
135+
136+
Reference: [Installing NGINX Open Source → Alpine packages](https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/#prebuilt_alpine).
137+
138+
Why allow multiple hashes? This is optional, but useful during a short rotation window:
139+
140+
- Ensure CI builds across branches/runners succeed while the upstream key change propagates.
141+
- Avoid flakes from CDN/caching delays where some environments still see the old key.
142+
- Let you pre-stage the new value before the official switch, then remove the old afterwards.
143+
144+
If you control all builds centrally and can update quickly, pass a single hash.
145+
88146
## Helping out
89147
If you're really eager to help out, here are a few places to get started:
90148
- Help answer questions on [our GitHub Discussions](https://github.com/serversideup/docker-php/discussions) and [our Discord](https://serversideup.net/discord)

0 commit comments

Comments
 (0)