Skip to content

Commit 4936ac9

Browse files
KingPinKingPin
authored andcommitted
feat(v2): migrate Debian base from bookworm to trixie with backward-compatible tags
- Update Dockerfile.v2 to use Debian trixie as base OS - Update library packages for trixie (including t64 time64 transition libs) - Support both trixie and bookworm BASEOS values for smooth transition - Update docker-ci.yml and docker-image.v2.yml matrices to build v2 on trixie - v1 images remain on bookworm (no change) - Add automatic bookworm tag aliasing for v2 trixie-built images - Also add bullseye compatibility tags for maximum backward compatibility This provides users pulling :bookworm tags with the latest trixie-built images while maintaining tag continuity. The same digest is served for both :trixie and :bookworm tags on v2 images.
1 parent 2dc6049 commit 4936ac9

File tree

3 files changed

+109
-14
lines changed

3 files changed

+109
-14
lines changed

.github/workflows/docker-ci.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,35 @@ jobs:
4242
exclude:
4343
- php-type: apache
4444
php-base: alpine
45+
# v2 uses trixie as the Debian base; bookworm retained for v1
46+
- variant: v2
47+
php-base: bookworm
48+
include:
49+
# v2 builds on trixie for Debian images
50+
- variant: v2
51+
php-version: '8.4'
52+
php-type: fpm
53+
php-base: trixie
54+
- variant: v2
55+
php-version: '8.4'
56+
php-type: cli
57+
php-base: trixie
58+
- variant: v2
59+
php-version: '8.3'
60+
php-type: fpm
61+
php-base: trixie
62+
- variant: v2
63+
php-version: '8.3'
64+
php-type: cli
65+
php-base: trixie
66+
- variant: v2
67+
php-version: '8.2'
68+
php-type: fpm
69+
php-base: trixie
70+
- variant: v2
71+
php-version: '8.2'
72+
php-type: cli
73+
php-base: trixie
4574

4675
name: ${{ matrix.variant }}-${{ matrix.php-version }}-${{ matrix.php-type }}-${{ matrix.php-base }}
4776

@@ -244,6 +273,47 @@ jobs:
244273
exclude:
245274
- php-type: apache
246275
php-base: alpine
276+
# v2 uses trixie as the Debian base; bookworm retained for v1
277+
- variant: v2
278+
php-base: bookworm
279+
include:
280+
# v2 builds on trixie for Debian images
281+
- variant: v2
282+
php-version: '8.4'
283+
php-type: fpm
284+
php-base: trixie
285+
- variant: v2
286+
php-version: '8.4'
287+
php-type: cli
288+
php-base: trixie
289+
- variant: v2
290+
php-version: '8.4'
291+
php-type: apache
292+
php-base: trixie
293+
- variant: v2
294+
php-version: '8.3'
295+
php-type: fpm
296+
php-base: trixie
297+
- variant: v2
298+
php-version: '8.3'
299+
php-type: cli
300+
php-base: trixie
301+
- variant: v2
302+
php-version: '8.3'
303+
php-type: apache
304+
php-base: trixie
305+
- variant: v2
306+
php-version: '8.2'
307+
php-type: fpm
308+
php-base: trixie
309+
- variant: v2
310+
php-version: '8.2'
311+
php-type: cli
312+
php-base: trixie
313+
- variant: v2
314+
php-version: '8.2'
315+
php-type: apache
316+
php-base: trixie
247317

248318
name: publish-${{ matrix.variant }}-${{ matrix.php-version }}-${{ matrix.php-type }}-${{ matrix.php-base }}
249319

@@ -318,6 +388,30 @@ jobs:
318388
${{ steps.vars.outputs.GHCR_TAG }}
319389
${{ steps.vars.outputs.QUAY_TAG }}
320390
391+
- name: Create bookworm compatibility tag for v2 trixie images
392+
if: matrix.variant == 'v2' && matrix.php-base == 'trixie'
393+
run: |
394+
echo "::group::Creating bookworm compatibility tags for trixie-built v2 image"
395+
396+
# Replace 'trixie' with 'bookworm' in tag names to maintain backward compatibility
397+
BOOKWORM_VERSION="${{ matrix.php-version }}-${{ matrix.php-type }}-bookworm"
398+
399+
# Create manifest aliases pointing trixie-built images to bookworm tags
400+
docker buildx imagetools create -t \
401+
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/php-docker:${BOOKWORM_VERSION}-v2 \
402+
${{ steps.vars.outputs.DOCKERHUB_TAG }}
403+
404+
docker buildx imagetools create -t \
405+
ghcr.io/kingpin/php-docker:${BOOKWORM_VERSION}-v2 \
406+
${{ steps.vars.outputs.GHCR_TAG }}
407+
408+
docker buildx imagetools create -t \
409+
quay.io/kingpinx1/php-docker:${BOOKWORM_VERSION}-v2 \
410+
${{ steps.vars.outputs.QUAY_TAG }}
411+
412+
echo "✅ Created bookworm compatibility tags pointing to trixie image"
413+
echo "::endgroup::"
414+
321415
- name: Run Trivy vulnerability scanner
322416
uses: aquasecurity/trivy-action@master
323417
with:

.github/workflows/docker-image.v2.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
echo '{
4242
"php-version": ["8.1", "8.2", "8.3", "8.4"],
4343
"php-type": ["cli", "fpm", "apache"],
44-
"php-base-os": ["bookworm", "alpine"],
44+
"php-base-os": ["trixie", "alpine"],
4545
"exclude": [
4646
{"php-type": "apache", "php-base-os": "alpine"}
4747
]
@@ -135,8 +135,10 @@ jobs:
135135
# Regular version tags
136136
ADDITIONAL_TAGS="${MAJOR_VERSION}-${{ matrix.php-type }}-${{ matrix.php-base-os }},${MINOR_VERSION}-${{ matrix.php-type }}-${{ matrix.php-base-os }}"
137137
138-
# Add bullseye-compatible tags for bookworm images
139-
if [[ "${{ matrix.php-base-os }}" == "bookworm" ]]; then
138+
# Add bookworm compatibility tags for trixie images (backward compatibility)
139+
# Also add bullseye tags for transition compatibility
140+
if [[ "${{ matrix.php-base-os }}" == "trixie" ]]; then
141+
ADDITIONAL_TAGS="${ADDITIONAL_TAGS},${{ matrix.php-version }}-${{ matrix.php-type }}-bookworm,${MAJOR_VERSION}-${{ matrix.php-type }}-bookworm,${MINOR_VERSION}-${{ matrix.php-type }}-bookworm"
140142
ADDITIONAL_TAGS="${ADDITIONAL_TAGS},${{ matrix.php-version }}-${{ matrix.php-type }}-bullseye,${MAJOR_VERSION}-${{ matrix.php-type }}-bullseye,${MINOR_VERSION}-${{ matrix.php-type }}-bullseye"
141143
fi
142144

Dockerfile.v2

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ ENV DEBIAN_FRONTEND=noninteractive
1111
# Install dependencies based on the base OS with BuildKit cache mounts
1212
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
1313
--mount=type=cache,target=/var/lib/apt,sharing=locked \
14-
if [ "$BASEOS" = "bookworm" ]; then \
15-
echo 'deb http://deb.debian.org/debian bookworm main' > /etc/apt/sources.list && \
14+
if [ "$BASEOS" = "trixie" ] || [ "$BASEOS" = "bookworm" ]; then \
1615
apt-get update && \
1716
apt-get -y upgrade && \
1817
apt-get install -y --no-install-recommends \
@@ -86,7 +85,7 @@ ARG TARGETARCH
8685
COPY --from=builder /usr/local/ /usr/local/
8786

8887
# Install S6 Overlay init system
89-
RUN if [ "$BASEOS" = "bookworm" ]; then \
88+
RUN if [ "$BASEOS" = "trixie" ] || [ "$BASEOS" = "bookworm" ]; then \
9089
apt-get update && \
9190
apt-get install -y --no-install-recommends \
9291
xz-utils \
@@ -122,26 +121,26 @@ RUN if [ "$BASEOS" = "bookworm" ]; then \
122121
fi
123122

124123
# Install required system libraries based on OS
125-
RUN if [ "$BASEOS" = "bookworm" ]; then \
124+
RUN if [ "$BASEOS" = "trixie" ] || [ "$BASEOS" = "bookworm" ]; then \
126125
apt-get update && \
127126
apt-get install -y --no-install-recommends \
128127
librabbitmq4 \
129-
libpng16-16 \
130-
libmagickwand-6.q16-6 \
128+
libpng16-16t64 \
129+
libmagickwand-6.q16-7t64 \
131130
libc-client2007e \
132131
libsnappy1v5 \
133132
libpq5 \
134-
libsnmp40 \
133+
libsnmp40t64 \
135134
libtidy5deb1 \
136-
libvips42 \
135+
libvips42t64 \
137136
libxslt1.1 \
138137
libyaml-0-2 \
139138
libzip4 \
140-
libmemcached11 \
139+
libmemcached11t64 \
141140
ghostscript \
142141
imagemagick \
143142
libwebp7 \
144-
libavif15 \
143+
libavif16t64 \
145144
libicu72 \
146145
libldap-2.5-0 \
147146
libuuid1 \
@@ -221,7 +220,7 @@ RUN chmod -R 755 /etc/cont-init.d /etc/services.d && \
221220
mkdir -p /var/run/s6 && \
222221
chmod -R 755 /var/run/s6 && \
223222
# Make sure scripts are executable and have correct line endings
224-
if [ "$BASEOS" = "bookworm" ]; then \
223+
if [ "$BASEOS" = "trixie" ] || [ "$BASEOS" = "bookworm" ]; then \
225224
apt-get update && \
226225
apt-get install -y --no-install-recommends dos2unix && \
227226
dos2unix /etc/cont-init.d/* /etc/services.d/php/* && \

0 commit comments

Comments
 (0)