Module Dockerfile_opam
Rules for generating Dockerfiles involving OPAM.
These are deployed at ocaml/opam2 on the Docker Hub. The interfaces here may change as the production deployments there change, so please contact anil@recoil.org
if you depend on these functions for your own infrastructure.
val run_as_opam : ('a, unit, string, Dockerfile.t) Pervasives.format4 ‑> 'a
run_as_opam fmt
runs the command specified by thefmt
format string as theopam
user.
val install_opam_from_source : ?prefix:string ‑> ?branch:string ‑> unit ‑> Dockerfile.t
Commands to install OPAM via a source code checkout from GitHub. The
branch
defaults to the1.2
stable branch. The binaries are installed under<prefix>/bin
, defaulting to/usr/local/bin
.
val gen_opam2_distro : ?labels:(string * string) list ‑> Dockerfile_distro.t ‑> string * Dockerfile.t
gen_opam2_distro d
will generate a Dockerfile for Linux distributiond
.- returns
a tuple of the Docker tag and the Dockerfile.
val opam2_mirror : string ‑> Dockerfile.t
opam2_mirror hub_id
generates an opam2 mirror archive that stores the results ofopam admin make
in the container when built. This container is suitable to serve as an archive mirror usingcohttp-lwt-unix
val all_ocaml_compilers : string ‑> Ocaml_version.arch ‑> Dockerfile_distro.t ‑> string * Dockerfile.t
all_ocaml_compilers hub_id arch distro
will generate an opam2 container that has all the recent OCaml compilers installed into a distributiondistro
on architecturearch
.
val separate_ocaml_compilers : string ‑> Ocaml_version.arch ‑> Dockerfile_distro.t ‑> (string * Dockerfile.t) list
separate_ocaml_compilers hub_id arch distro
will install a list of Dockerfiles that build individual OCaml compiler versions and their variants (e.g. flambda) in separate containers.
val bulk_build : string ‑> Dockerfile_distro.t ‑> Ocaml_version.t ‑> string ‑> Dockerfile.t
bulk_build hub_id distro ov rev
will setup a bulk build environment for OCaml versionov
on distributiondistro
using the Git revisionrev
from opam-repository.