forked from nginx/unit
-
Notifications
You must be signed in to change notification settings - Fork 1
363 lines (323 loc) · 13.3 KB
/
Copy pathdocker.yml
File metadata and controls
363 lines (323 loc) · 13.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# .github/workflows/docker.yml
#
# Builds multi-arch Docker images (amd64 + arm64) and pushes to GHCR.
# Triggered on release tags (v*) or manually via workflow_dispatch.
#
# Language version support policy:
# Each image is supported for 1 year after the language/runtime EOL.
# EOL dates: https://endoflife.date
# To drop a variant: remove its entry from matrix.include and note it in CHANGES.
#
# EOL status (as of April 2026):
# go1.24 EOL ~Feb 2026 -> supported until Feb 2027
# go1.25 EOL ~Aug 2026 -> supported until Aug 2027
# go1.26 EOL ~Feb 2027 -> supported until Feb 2028
# jsc17 EOL Sep 2029 (OpenJDK 17 LTS, Eclipse Temurin) -> supported until Sep 2030
# jsc21 EOL Sep 2031 (OpenJDK 21 LTS, Eclipse Temurin) -> supported until Sep 2032
# node20 EOL Apr 2026 -> supported until Apr 2027
# node22 EOL Apr 2027 -> supported until Apr 2028
# node24 EOL Apr 2028 -> supported until Apr 2029
# perl5.38 EOL ~Jul 2026 -> supported until Jul 2027
# perl5.40 EOL ~Jul 2028 -> supported until Jul 2029
# php8.3 EOL Dec 2027 -> supported until Dec 2028
# php8.4 EOL Dec 2028 -> supported until Dec 2029
# php8.5 EOL Dec 2029 -> supported until Dec 2030
# python3.12 EOL Oct 2028 -> supported until Oct 2029
# python3.13 EOL Oct 2029 -> supported until Oct 2030
# python3.14 EOL Oct 2030 -> supported until Oct 2031
# ruby3.3 EOL Mar 2027 -> supported until Mar 2028
# ruby3.4 EOL Mar 2028 -> supported until Mar 2029
# wasm no EOL
# minimal no EOL
name: Build and Push Docker Images
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
tag:
description: 'Version tag (e.g. 1.35.0)'
required: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: freeunitorg/freeunit
jobs:
build-amd64:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
# -- minimal -------------------------------------------------------
- variant: minimal
dockerfile: pkg/docker/Dockerfile.minimal
# -- wasm ----------------------------------------------------------
- variant: wasm
dockerfile: pkg/docker/Dockerfile.wasm
# -- Go ------------------------------------------------------------
- variant: go1.24
dockerfile: pkg/docker/Dockerfile.go1.24
- variant: go1.25
dockerfile: pkg/docker/Dockerfile.go1.25
- variant: go1.26
dockerfile: pkg/docker/Dockerfile.go1.26
# -- JSC (Java Servlet Container / OpenJDK) --------------------------------
# Java support for .war/.jsp applications via Eclipse Temurin (OpenJDK)
# Base image: eclipse-temurin:17-jdk-noble (Ubuntu 24.04, GPL v2)
- variant: jsc17
dockerfile: pkg/docker/Dockerfile.jsc17
# Base image: eclipse-temurin:21-jdk-noble (Ubuntu 24.04, GPL v2)
- variant: jsc21
dockerfile: pkg/docker/Dockerfile.jsc21
# -- Node.js -------------------------------------------------------
- variant: node20
dockerfile: pkg/docker/Dockerfile.node20
- variant: node22
dockerfile: pkg/docker/Dockerfile.node22
- variant: node24
dockerfile: pkg/docker/Dockerfile.node24
# -- Perl ----------------------------------------------------------
- variant: perl5.38
dockerfile: pkg/docker/Dockerfile.perl5.38
- variant: perl5.40
dockerfile: pkg/docker/Dockerfile.perl5.40
# -- PHP -----------------------------------------------------------
- variant: php8.3
dockerfile: pkg/docker/Dockerfile.php8.3
- variant: php8.4
dockerfile: pkg/docker/Dockerfile.php8.4
- variant: php8.5
dockerfile: pkg/docker/Dockerfile.php8.5
# -- Python --------------------------------------------------------
- variant: python3.12
dockerfile: pkg/docker/Dockerfile.python3.12
- variant: python3.12-slim
dockerfile: pkg/docker/Dockerfile.python3.12-slim
- variant: python3.13
dockerfile: pkg/docker/Dockerfile.python3.13
- variant: python3.13-slim
dockerfile: pkg/docker/Dockerfile.python3.13-slim
- variant: python3.14
dockerfile: pkg/docker/Dockerfile.python3.14
- variant: python3.14-slim
dockerfile: pkg/docker/Dockerfile.python3.14-slim
# -- Ruby ----------------------------------------------------------
- variant: ruby3.3
dockerfile: pkg/docker/Dockerfile.ruby3.3
- variant: ruby3.4
dockerfile: pkg/docker/Dockerfile.ruby3.4
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.tag }}"
else
VERSION="${GITHUB_REF_NAME#v}"
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Pin version in Dockerfile
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
sed -i \
-e "s|-b [0-9][0-9.]*\( https://github.com/freeunitorg/freeunit\)|-b ${VERSION}\1|" \
-e "s|image.version=\"[^\"]*\"|image.version=\"${VERSION}\"|" \
${{ matrix.dockerfile }}
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push (AMD64)
uses: docker/build-push-action@v7
with:
context: pkg/docker
file: ${{ matrix.dockerfile }}
platforms: linux/amd64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-${{ matrix.variant }}-amd64
labels: |
org.opencontainers.image.source=https://github.com/freeunitorg/freeunit
cache-from: type=gha,scope=amd64-${{ matrix.variant }}
cache-to: type=gha,mode=max,scope=amd64-${{ matrix.variant }}
build-arm64:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
# -- minimal -------------------------------------------------------
- variant: minimal
dockerfile: pkg/docker/Dockerfile.minimal
# -- wasm ----------------------------------------------------------
- variant: wasm
dockerfile: pkg/docker/Dockerfile.wasm
# -- Go ------------------------------------------------------------
- variant: go1.24
dockerfile: pkg/docker/Dockerfile.go1.24
- variant: go1.25
dockerfile: pkg/docker/Dockerfile.go1.25
- variant: go1.26
dockerfile: pkg/docker/Dockerfile.go1.26
# -- JSC (Java / GraalVM) ------------------------------------------
- variant: jsc17
dockerfile: pkg/docker/Dockerfile.jsc17
- variant: jsc21
dockerfile: pkg/docker/Dockerfile.jsc21
# -- Node.js -------------------------------------------------------
- variant: node20
dockerfile: pkg/docker/Dockerfile.node20
- variant: node22
dockerfile: pkg/docker/Dockerfile.node22
- variant: node24
dockerfile: pkg/docker/Dockerfile.node24
# -- Perl ----------------------------------------------------------
- variant: perl5.38
dockerfile: pkg/docker/Dockerfile.perl5.38
- variant: perl5.40
dockerfile: pkg/docker/Dockerfile.perl5.40
# -- PHP -----------------------------------------------------------
- variant: php8.3
dockerfile: pkg/docker/Dockerfile.php8.3
- variant: php8.4
dockerfile: pkg/docker/Dockerfile.php8.4
- variant: php8.5
dockerfile: pkg/docker/Dockerfile.php8.5
# -- Python --------------------------------------------------------
- variant: python3.12
dockerfile: pkg/docker/Dockerfile.python3.12
- variant: python3.12-slim
dockerfile: pkg/docker/Dockerfile.python3.12-slim
- variant: python3.13
dockerfile: pkg/docker/Dockerfile.python3.13
- variant: python3.13-slim
dockerfile: pkg/docker/Dockerfile.python3.13-slim
- variant: python3.14
dockerfile: pkg/docker/Dockerfile.python3.14
- variant: python3.14-slim
dockerfile: pkg/docker/Dockerfile.python3.14-slim
# -- Ruby ----------------------------------------------------------
- variant: ruby3.3
dockerfile: pkg/docker/Dockerfile.ruby3.3
- variant: ruby3.4
dockerfile: pkg/docker/Dockerfile.ruby3.4
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.tag }}"
else
VERSION="${GITHUB_REF_NAME#v}"
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Pin version in Dockerfile
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
sed -i \
-e "s|-b [0-9][0-9.]*\( https://github.com/freeunitorg/freeunit\)|-b ${VERSION}\1|" \
-e "s|image.version=\"[^\"]*\"|image.version=\"${VERSION}\"|" \
${{ matrix.dockerfile }}
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push (ARM64)
uses: docker/build-push-action@v7
with:
context: pkg/docker
file: ${{ matrix.dockerfile }}
platforms: linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-${{ matrix.variant }}-arm64
labels: |
org.opencontainers.image.source=https://github.com/freeunitorg/freeunit
cache-from: type=gha,scope=arm64-${{ matrix.variant }}
cache-to: type=gha,mode=max,scope=arm64-${{ matrix.variant }}
merge:
runs-on: ubuntu-latest
needs: [build-amd64, build-arm64]
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- variant: minimal
- variant: wasm
- variant: go1.24
- variant: go1.25
- variant: go1.26
# -- JSC (Java / GraalVM) ------------------------------------------
- variant: jsc17
- variant: jsc21
- variant: node20
- variant: node22
- variant: node24
- variant: perl5.38
- variant: perl5.40
- variant: php8.3
- variant: php8.4
- variant: php8.5
- variant: python3.12
- variant: python3.12-slim
- variant: python3.13
- variant: python3.13-slim
- variant: python3.14
- variant: python3.14-slim
- variant: ruby3.3
- variant: ruby3.4
steps:
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.tag }}"
else
VERSION="${GITHUB_REF_NAME#v}"
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Create and push multi-arch manifest
run: |
VERSION="${{ steps.version.outputs.VERSION }}"
VARIANT="${{ matrix.variant }}"
REPO="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
docker buildx imagetools create \
--tag ${REPO}:${VERSION}-${VARIANT} \
--tag ${REPO}:latest-${VARIANT} \
--annotation "index:org.opencontainers.image.description=FreeUnit ${VERSION} (${VARIANT}) — community LTS fork of the NGINX Unit application server" \
--annotation "index:org.opencontainers.image.title=FreeUnit (${VARIANT})" \
--annotation "index:org.opencontainers.image.url=https://freeunit.org" \
--annotation "index:org.opencontainers.image.source=https://github.com/freeunitorg/freeunit" \
--annotation "index:org.opencontainers.image.vendor=FreeUnit Community" \
--annotation "index:org.opencontainers.image.version=${VERSION}" \
${REPO}:${VERSION}-${VARIANT}-amd64 \
${REPO}:${VERSION}-${VARIANT}-arm64
docker buildx imagetools inspect ${REPO}:${VERSION}-${VARIANT}