ocaml/opam
The OCaml opam package manager images
1M+
Latest docker base-images with opam pre-installed along with a specific OCaml compiler version.
💡 The following repositories are no longer updated:
ocaml/opam2
,ocaml/opam2-staging
,ocurrent/opam
andocaml/ocaml
. To get the latest and greatest images use this repository (ocaml/opam).
The base-images are updated weekly using an OCurrentpipeline. The pipeline has a web interface which also displays the build logs for each container.
💡 These images are primary intended for OCaml's Continuous Testing systems, and can be a little quirky to use as development images. However, please do ask questions both on OCaml's Discuss forum and on the docker-base-images issue tracker).
The images are tagged in a specific format, the most verbose of which contains the OCaml version and the distribution version such as ocaml/opam:debian-10-ocaml-4.12
.
All other tags are aliases to the latest version of a distribution and/or the OCaml compiler. For example if the latest Debian is version 11
and the latest OCaml is 4.13
then ocaml/opam:debian
is an alias of ocaml/opam:debian-11-ocaml-4.13
.
The OCaml version will always point to the latest patch version, so 4.11
will be 4.11.X
for the greatest X
that is released. There are also some alternate OCaml configurations such as with flambda enabled or with frame pointers enabled.
Arch Linux is a rolling release, so there is just the archlinux
and no archlinux-version
tag. The ubuntu
tag is always the latest release of Ubuntu. ubuntu-lts
is always the most recent LTS release. Windows is available in two flavours: windows-mingw-
has the MinGW-w64 native Windows port installed and windows-msvc
has the Microsoft Visual Studio port enabled.
The base-images pipeline uses ocaml-version and ocaml-dockerfile at particular commits to generate the tag names. You can use these libraries too if you are automating some process that requires base-image tag names in OCaml.
All of the tags are available on docker-hub. Also note, the images are multi-arch images including support for 32 and 64 bit where possible and arm
, x86
and ppc
.
The latest
tag is the latest release of OCaml running on the latest version of Debian (Debian is used as it has the widest architecture support for OCaml).
The archive
tag contains a snapshot of all the source archives for opam-repository generated by opam admin cache
in /cache
and can be used to set-up a local archive cache.
Each image contains the following:
opam
opam-repository
from when the base-image was createdopam
The last point is important. If you use the base-images as a base to build upon in a Dockerfile (i.e. FROM ocaml/opam...
) this will be run as the opam
user. This can cause permission errors if you try to build somewhere that needs root access. You can either change the user to root
before building anything or ensure you build somewhere you have access to such as /home/opam
. This can also catch you out when copying files and directories into the image. If you need the opam
user to have access to them be sure to COPY --chown=opam <SRCs> <DST>
.
The base-images are used in lots of other OCaml projects including ocaml-ci, opam-repo-ci and opam-health-check. Quite often you will see them as the sha256
hash which points to a specific image (maybe not the latest). This is particularly useful in applications like ocaml-ci for users to reproduce the build if it's failing.
docker pull ocaml/opam