Skip to content

Commit 4a26fcc

Browse files
authored
Merge pull request #225 from ocurrent/alpine-3.21
Add Alpine 3.21, deprecate Alpine 3.20
2 parents dc5ab75 + 6c56d27 commit 4a26fcc

File tree

12 files changed

+479
-430
lines changed

12 files changed

+479
-430
lines changed

.ocamlformat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
profile = conventional
2-
version = 0.26.2
2+
version = 0.27.0
33
ocaml-version = 4.08

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
unreleased
2+
----------
3+
4+
- Add Alpine 3.21, deprecate Alpine 3.20. (@MisterDA, #225)
5+
16
v8.2.4 2024-11-18
27
-----------------
38

src-cmd/dockerfile_cmd.mli

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
(** Command invocation library to help with Docker builds.
1919
2020
This module primarily exposes utility functions to glue together
21-
Docker-based scripts for (e.g.) continuous integration systems
22-
like the ocaml-ci. The interface is fairly domain-specific and
23-
does not expose all the functionality of the underlying tools.
24-
Feel free to contribute more functions if you need them. *)
21+
Docker-based scripts for (e.g.) continuous integration systems like the
22+
ocaml-ci. The interface is fairly domain-specific and does not expose all
23+
the functionality of the underlying tools. Feel free to contribute more
24+
functions if you need them. *)
2525

2626
type cmd_log = {
2727
command : string;
@@ -39,8 +39,8 @@ val run_log :
3939
string ->
4040
Bos.Cmd.t ->
4141
(unit, [> `Msg of string ]) result
42-
(** [runlog log_dir name cmd] will run [cmd] with label [name]
43-
and log the results in [<log_dir>/<name>.sxp]. *)
42+
(** [runlog log_dir name cmd] will run [cmd] with label [name] and log the
43+
results in [<log_dir>/<name>.sxp]. *)
4444

4545
(** Docker command invocation *)
4646
module Docker : sig

src-cmd/gen.mli

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ val generate_dockerfile :
2323
Fpath.t ->
2424
Dockerfile.t ->
2525
(unit, [> `Msg of string ]) result
26-
(** [generate_dockerfile output_dir docker] will output Dockerfile inside
27-
the [output_dir] subdirectory.
26+
(** [generate_dockerfile output_dir docker] will output Dockerfile inside the
27+
[output_dir] subdirectory.
2828
2929
The [crunch] argument defaults to true and applies the {!Dockerfile.crunch}
3030
optimisation to reduce the number of layers; disable it if you really want
@@ -35,9 +35,9 @@ val generate_dockerfiles :
3535
Fpath.t ->
3636
(string * Dockerfile.t) list ->
3737
(unit, [> `Msg of string ]) result
38-
(** [generate_dockerfiles output_dir (name * docker)] will
39-
output a list of Dockerfiles inside the [output_dir/] subdirectory,
40-
with each Dockerfile named as [Dockerfile.<release>].
38+
(** [generate_dockerfiles output_dir (name * docker)] will output a list of
39+
Dockerfiles inside the [output_dir/] subdirectory, with each Dockerfile
40+
named as [Dockerfile.<release>].
4141
4242
The [crunch] argument defaults to true and applies the {!Dockerfile.crunch}
4343
optimisation to reduce the number of layers; disable it if you really want
@@ -48,9 +48,9 @@ val generate_dockerfiles_in_directories :
4848
Fpath.t ->
4949
(string * Dockerfile.t) list ->
5050
(unit, [> `Msg of string ]) result
51-
(** [generate_dockerfiles_in_directories output_dir (name * docker)] will
52-
output a list of Dockerfiles inside the [output_dir/name] subdirectory,
53-
with each directory containing the Dockerfile specified by [docker].
51+
(** [generate_dockerfiles_in_directories output_dir (name * docker)] will output
52+
a list of Dockerfiles inside the [output_dir/name] subdirectory, with each
53+
directory containing the Dockerfile specified by [docker].
5454
5555
The [crunch] argument defaults to true and applies the {!Dockerfile.crunch}
5656
optimisation to reduce the number of layers; disable it if you really want
@@ -63,12 +63,12 @@ val generate_dockerfiles_in_git_branches :
6363
(string * Dockerfile.t) list ->
6464
(unit, [> `Msg of string ]) result
6565
(** [generate_dockerfiles_in_git_branches output_dir (name * docker)] will
66-
output a set of git branches in the [output_dir] Git repository.
67-
Each branch will be named [name] and contain a single [docker] file.
68-
The contents of these branches will be reset, so this should be
69-
only be used on an [output_dir] that is a dedicated Git repository
70-
for this purpose. If [readme] is specified, the contents will be
71-
written to [README.md] in that branch.
66+
output a set of git branches in the [output_dir] Git repository. Each branch
67+
will be named [name] and contain a single [docker] file. The contents of
68+
these branches will be reset, so this should be only be used on an
69+
[output_dir] that is a dedicated Git repository for this purpose. If
70+
[readme] is specified, the contents will be written to [README.md] in that
71+
branch.
7272
7373
The [crunch] argument defaults to true and applies the {!Dockerfile.crunch}
7474
optimisation to reduce the number of layers; disable it if you really want

src-opam/distro.ml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ type distro =
3939
| `V3_17
4040
| `V3_18
4141
| `V3_19
42-
| `V3_20 ]
42+
| `V3_20
43+
| `V3_21 ]
4344
| `Archlinux of [ `Latest ]
4445
| `CentOS of [ `V6 | `V7 | `V8 ]
4546
| `Debian of [ `V12 | `V11 | `V10 | `V9 | `V8 | `V7 | `Testing | `Unstable ]
@@ -126,6 +127,7 @@ type t =
126127
| `V3_18
127128
| `V3_19
128129
| `V3_20
130+
| `V3_21
129131
| `Latest ]
130132
| `Archlinux of [ `Latest ]
131133
| `CentOS of [ `V6 | `V7 | `V8 | `Latest ]
@@ -252,6 +254,7 @@ let distros : t list =
252254
`Alpine `V3_18;
253255
`Alpine `V3_19;
254256
`Alpine `V3_20;
257+
`Alpine `V3_21;
255258
`Alpine `Latest;
256259
`Archlinux `Latest;
257260
`CentOS `V6;
@@ -343,7 +346,7 @@ let distros : t list =
343346

344347
let resolve_alias (d : t) : distro =
345348
match d with
346-
| `Alpine `Latest -> `Alpine `V3_20
349+
| `Alpine `Latest -> `Alpine `V3_21
347350
| `CentOS `Latest -> `CentOS `V7
348351
| `Debian `Stable -> `Debian `V12
349352
| `Fedora `Latest -> `Fedora `V41
@@ -357,7 +360,7 @@ let resolve_alias (d : t) : distro =
357360
| ( `Alpine
358361
( `V3_3 | `V3_4 | `V3_5 | `V3_6 | `V3_7 | `V3_8 | `V3_9 | `V3_10
359362
| `V3_11 | `V3_12 | `V3_13 | `V3_14 | `V3_15 | `V3_16 | `V3_17 | `V3_18
360-
| `V3_19 | `V3_20 )
363+
| `V3_19 | `V3_20 | `V3_21 )
361364
| `Archlinux `Latest
362365
| `CentOS (`V6 | `V7 | `V8)
363366
| `Debian (`V7 | `V8 | `V9 | `V10 | `V11 | `V12 | `Testing | `Unstable)
@@ -387,9 +390,9 @@ let distro_status (d : t) : status =
387390
| `Alpine
388391
( `V3_3 | `V3_4 | `V3_5 | `V3_6 | `V3_7 | `V3_8 | `V3_9 | `V3_10
389392
| `V3_11 | `V3_12 | `V3_13 | `V3_14 | `V3_15 | `V3_16 | `V3_17 | `V3_18
390-
| `V3_19 ) ->
393+
| `V3_19 | `V3_20 ) ->
391394
`Deprecated
392-
| `Alpine `V3_20 -> `Active `Tier1
395+
| `Alpine `V3_21 -> `Active `Tier1
393396
| `Archlinux `Latest -> `Active `Tier3
394397
| `CentOS `V7 -> `Active `Tier3
395398
| `CentOS (`V6 | `V8) -> `Deprecated
@@ -462,7 +465,8 @@ let distro_arches ov (d : t) =
462465
[ `I386; `X86_64; `Aarch64; `Aarch32 ]
463466
| ( `Alpine
464467
( `V3_6 | `V3_7 | `V3_8 | `V3_9 | `V3_10 | `V3_11 | `V3_12 | `V3_13
465-
| `V3_14 | `V3_15 | `V3_16 | `V3_17 | `V3_18 | `V3_19 | `V3_20 ),
468+
| `V3_14 | `V3_15 | `V3_16 | `V3_17 | `V3_18 | `V3_19 | `V3_20 | `V3_21
469+
),
466470
ov )
467471
when OV.(compare Releases.v4_05_0 ov) = -1 ->
468472
[ `X86_64; `Aarch64 ]
@@ -576,6 +580,7 @@ let builtin_ocaml_of_distro (d : t) : string option =
576580
| `Alpine `V3_18 -> Some "4.14.1"
577581
| `Alpine `V3_19 -> Some "4.14.1"
578582
| `Alpine `V3_20 -> Some "4.14.2"
583+
| `Alpine `V3_21 -> Some "4.14.2"
579584
| `Archlinux `Latest -> Some "5.1.0"
580585
| `Fedora `V21 -> Some "4.01.0"
581586
| `Fedora `V22 -> Some "4.02.0"
@@ -704,6 +709,7 @@ let tag_of_distro (d : t) =
704709
| `Alpine `V3_18 -> "alpine-3.18"
705710
| `Alpine `V3_19 -> "alpine-3.19"
706711
| `Alpine `V3_20 -> "alpine-3.20"
712+
| `Alpine `V3_21 -> "alpine-3.21"
707713
| `Alpine `Latest -> "alpine"
708714
| `Archlinux `Latest -> "archlinux"
709715
| `OpenSUSE `V42_1 -> "opensuse-42.1"
@@ -920,6 +926,7 @@ let human_readable_string_of_distro (d : t) =
920926
| `Alpine `V3_18 -> "Alpine 3.18"
921927
| `Alpine `V3_19 -> "Alpine 3.19"
922928
| `Alpine `V3_20 -> "Alpine 3.20"
929+
| `Alpine `V3_21 -> "Alpine 3.21"
923930
| `Archlinux `Latest -> "Archlinux"
924931
| `OpenSUSE `V42_1 -> "OpenSUSE 42.1"
925932
| `OpenSUSE `V42_2 -> "OpenSUSE 42.2"
@@ -1071,7 +1078,8 @@ let bubblewrap_version (t : t) =
10711078
| `Alpine `V3_17 -> Some (0, 7, 0)
10721079
| `Alpine `V3_18 -> Some (0, 8, 0)
10731080
| `Alpine `V3_19 -> Some (0, 8, 0)
1074-
| `Alpine `V3_20 -> Some (0, 9, 0)
1081+
| `Alpine `V3_20 -> Some (0, 10, 0)
1082+
| `Alpine `V3_21 -> Some (0, 11, 0)
10751083
| `Archlinux `Latest -> Some (0, 8, 0)
10761084
| `OpenSUSE `V42_1 -> None (* Not actually checked *)
10771085
| `OpenSUSE `V42_2 -> None (* Not actually checked *)
@@ -1111,6 +1119,7 @@ let base_distro_tag ?(arch = `X86_64) d =
11111119
| `V3_18 -> "3.18"
11121120
| `V3_19 -> "3.19"
11131121
| `V3_20 -> "3.20"
1122+
| `V3_21 -> "3.21"
11141123
in
11151124
match arch with `I386 -> ("i386/alpine", tag) | _ -> ("alpine", tag))
11161125
| `Archlinux `Latest -> ("archlinux", "latest")

src-opam/distro.mli

Lines changed: 53 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
*
1616
*)
1717

18-
(** Run Opam commands across a matrix of Docker containers.
19-
Each of these containers represents a different version of
20-
OCaml, Opam and an OS distribution (such as Debian or Alpine).
21-
*)
18+
(** Run Opam commands across a matrix of Docker containers. Each of these
19+
containers represents a different version of OCaml, Opam and an OS
20+
distribution (such as Debian or Alpine). *)
2221

2322
(** {2 Known distributions and OCaml variants} *)
2423

@@ -41,7 +40,8 @@ type distro =
4140
| `V3_17
4241
| `V3_18
4342
| `V3_19
44-
| `V3_20 ]
43+
| `V3_20
44+
| `V3_21 ]
4545
| `Archlinux of [ `Latest ]
4646
| `CentOS of [ `V6 | `V7 | `V8 ]
4747
| `Debian of [ `V12 | `V11 | `V10 | `V9 | `V8 | `V7 | `Testing | `Unstable ]
@@ -128,6 +128,7 @@ type t =
128128
| `V3_18
129129
| `V3_19
130130
| `V3_20
131+
| `V3_21
131132
| `Latest ]
132133
| `Archlinux of [ `Latest ]
133134
| `CentOS of [ `V6 | `V7 | `V8 | `Latest ]
@@ -207,20 +208,19 @@ val os_family_of_distro : t -> os_family
207208
(** [os_family_of_distro t] returns the OS family of the distro. *)
208209

209210
val os_family_to_string : os_family -> string
210-
(** [os_family_to_string os] returns a string representing the OS
211-
family. *)
211+
(** [os_family_to_string os] returns a string representing the OS family. *)
212212

213213
val opam_repository : os_family -> string
214-
(** [opam_repository os_family] returns the git URL to the default
215-
Opam repository. *)
214+
(** [opam_repository os_family] returns the git URL to the default Opam
215+
repository. *)
216216

217217
val personality : os_family -> Ocaml_version.arch -> string option
218-
(** [personality os_family arch] returns the personality associated to
219-
the architecture, if [os_family] is [`Linux]. *)
218+
(** [personality os_family arch] returns the personality associated to the
219+
architecture, if [os_family] is [`Linux]. *)
220220

221221
val is_same_distro : t -> t -> bool
222-
(** [is_same_distro d1 d2] returns whether [d1] is the same distro as
223-
[d2], regardless of their respective versions. *)
222+
(** [is_same_distro d1 d2] returns whether [d1] is the same distro as [d2],
223+
regardless of their respective versions. *)
224224

225225
val compare : t -> t -> int
226226
(** [compare a b] is a lexical comparison function for {!t}. *)
@@ -236,21 +236,20 @@ val latest_distros : t list
236236
(** Enumeration of the latest stable (ideally LTS) supported distributions. *)
237237

238238
val master_distro : t
239-
(** The distribution that is the top-level alias for the [latest] tag
240-
in the [ocaml/opam2] Docker Hub build. *)
239+
(** The distribution that is the top-level alias for the [latest] tag in the
240+
[ocaml/opam2] Docker Hub build. *)
241241

242242
val builtin_ocaml_of_distro : t -> string option
243-
(** [builtin_ocaml_of_distro t] will return the OCaml version
244-
supplied with the distribution packaging, and [None] if there
245-
is no supported version. *)
243+
(** [builtin_ocaml_of_distro t] will return the OCaml version supplied with the
244+
distribution packaging, and [None] if there is no supported version. *)
246245

247246
val human_readable_string_of_distro : t -> string
248-
(** [human_readable_string_of_distro t] returns a human readable
249-
version of the distribution tag, including version information. *)
247+
(** [human_readable_string_of_distro t] returns a human readable version of the
248+
distribution tag, including version information. *)
250249

251250
val human_readable_short_string_of_distro : t -> string
252-
(** [human_readable_short_string_of_distro t] returns a human readable
253-
short version of the distribution tag, excluding version information. *)
251+
(** [human_readable_short_string_of_distro t] returns a human readable short
252+
version of the distribution tag, excluding version information. *)
254253

255254
type package_manager =
256255
[ `Apk (** Alpine Apk *)
@@ -278,59 +277,56 @@ val tag_of_distro : t -> string
278277
(** [tag_of_distro t] convert a distribution [t] to a Docker Hub tag. *)
279278

280279
val distro_of_tag : string -> t option
281-
(** [distro_of_tag s] parses [s] into a {!t} distribution, and
282-
[None] otherwise. *)
280+
(** [distro_of_tag s] parses [s] into a {!t} distribution, and [None] otherwise.
281+
*)
283282

284283
val latest_tag_of_distro : t -> string
285-
(** [latest_tag_of_distro distro] will generate a Docker Hub
286-
tag that is a convenient short form for the latest stable
287-
release of a particular distribution. This tag will be
288-
regularly rewritten to point to any new releases of the
289-
distribution. *)
284+
(** [latest_tag_of_distro distro] will generate a Docker Hub tag that is a
285+
convenient short form for the latest stable release of a particular
286+
distribution. This tag will be regularly rewritten to point to any new
287+
releases of the distribution. *)
290288

291289
val base_distro_tag : ?arch:Ocaml_version.arch -> t -> string * string
292290
(** [base_distro_tag ?arch t] will return a tuple of a Docker Hub
293-
user/repository and tag for which the base image of a distribution
294-
can be found (e.g. [opensuse/leap],[15.0] which maps to [opensuse/leap:15.0]
295-
on the Docker Hub). This base image is in turn can be used to generate opam
296-
and other OCaml tool Dockerfiles. [arch] defaults to [x86_64] and can vary
297-
the base user/repository since some architecture are built elsewhere. *)
291+
user/repository and tag for which the base image of a distribution can be
292+
found (e.g. [opensuse/leap],[15.0] which maps to [opensuse/leap:15.0] on the
293+
Docker Hub). This base image is in turn can be used to generate opam and
294+
other OCaml tool Dockerfiles. [arch] defaults to [x86_64] and can vary the
295+
base user/repository since some architecture are built elsewhere. *)
298296

299297
(** {2 CPU architectures} *)
300298

301299
val distro_arches : Ocaml_version.t -> t -> Ocaml_version.arch list
302-
(** [distro_arches ov t] returns the list of architectures that
303-
distribution [t] is supported on for OCaml compiler version [ov] *)
300+
(** [distro_arches ov t] returns the list of architectures that distribution [t]
301+
is supported on for OCaml compiler version [ov] *)
304302

305303
val distro_supported_on : Ocaml_version.arch -> Ocaml_version.t -> t -> bool
306-
(** [distro_supported_on arch ov distro] returns [true] if the
307-
combination of CPU [arch], compiler version [ov] is available
308-
on the distribution [distro]. *)
304+
(** [distro_supported_on arch ov distro] returns [true] if the combination of
305+
CPU [arch], compiler version [ov] is available on the distribution [distro].
306+
*)
309307

310308
(** {2 Opam build infrastructure support} *)
311309

312310
val active_distros : Ocaml_version.arch -> t list
313-
(** [active_distros arch] returns the list of currently supported
314-
distributions in the opam build infrastructure. Distributions
315-
that are end-of-life upstream will rotate out of this list
316-
regularly. *)
311+
(** [active_distros arch] returns the list of currently supported distributions
312+
in the opam build infrastructure. Distributions that are end-of-life
313+
upstream will rotate out of this list regularly. *)
317314

318315
val active_tier1_distros : Ocaml_version.arch -> t list
319-
(** Tier 1 distributions are those supported for the full matrix
320-
of compiler versions in the opam build infrastructure.
321-
The {{:https://github.com/ocurrent/docker-base-images}Docker base images}
322-
will compile a base image for every OCaml version, so this
323-
list should be added to sparingly. *)
316+
(** Tier 1 distributions are those supported for the full matrix of compiler
317+
versions in the opam build infrastructure. The
318+
{{:https://github.com/ocurrent/docker-base-images}Docker base images} will
319+
compile a base image for every OCaml version, so this list should be added
320+
to sparingly. *)
324321

325322
val active_tier2_distros : Ocaml_version.arch -> t list
326-
(** Tier 2 distributions are those supported for a limited set
327-
of compiler versions in the opam build infrastructure. The
328-
distros in this list are also tested for packages in the
329-
opam repository. *)
323+
(** Tier 2 distributions are those supported for a limited set of compiler
324+
versions in the opam build infrastructure. The distros in this list are also
325+
tested for packages in the opam repository. *)
330326

331327
val active_tier3_distros : Ocaml_version.arch -> t list
332-
(** Tier 3 distributions are those supported for a limited set
333-
of compiler versions in the opam build infrastructure. While
334-
these distros will have base images compiled for them, they
335-
are not widely tested. Distros maybe here as they are on the
336-
way to being deprecated, or new and still experimental. *)
328+
(** Tier 3 distributions are those supported for a limited set of compiler
329+
versions in the opam build infrastructure. While these distros will have
330+
base images compiled for them, they are not widely tested. Distros maybe
331+
here as they are on the way to being deprecated, or new and still
332+
experimental. *)

src-opam/dockerfile_opam.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
(** Rules for generating Dockerfiles involving OPAM.
1919
20-
These are deployed at {{:https://hub.docker.com/r/ocaml/opam}ocaml/opam}
21-
on the Docker Hub. The interfaces here may change as the production deployments
20+
These are deployed at {{:https://hub.docker.com/r/ocaml/opam}ocaml/opam} on
21+
the Docker Hub. The interfaces here may change as the production deployments
2222
there change, so please contact [[email protected]] if you depend on these
2323
functions for your own infrastructure. *)
2424

0 commit comments

Comments
 (0)