Opam-ci: new distributions available

opam

#1

I’ve pushed a update to the Dockerfile generation on the ocaml/opam2 Docker Hub images to account for newer distributions that have been released. We now build:

  • fedora-29 (alias fedora)
  • alpine-3.8 (alias alpine)
  • opensuse-15.0 (alias opensuse)
  • ubuntu-18.10 (alias ubuntu)

We now also publish the development version of the compiler to make for easier testing of trunk, via the 4.08 tag.

The full list can be found on the containers infrastructure wiki along with general instructions on how to use the Docker images.

The source code that generates these images is in ocaml-dockerfile for the library, obi for the binaries. If you are interested in adding a new Linux distribution, take a look at Dockerfile_distro module for how to get started.


#2

Where can we read the final generated Dockerfile that avsm/ocaml-dockerfile is being used to create?
I’d like to check how ocaml is being installed and setup for the given ocaml image I’d like to build from.


#3

Every image on ocaml/opam2 includes the Dockerfile used to create it within the image itself, in /Dockerfile (thanks to a user request).

e.g.:

$ docker run ocaml/opam2 cat /Dockerfile
# Autogenerated by OCaml-Dockerfile scripts
FROM ocaml/opam2:debian-9-opam
WORKDIR /home/opam/opam-repository
RUN git pull origin master && \
  opam-sandbox-disable && \
  opam init -k git -a /home/opam/opam-repository --bare && \
  opam switch create 4.03 ocaml-base-compiler.4.03.0 && \
  opam switch create 4.04 ocaml-base-compiler.4.04.2 && \
  opam switch create 4.05 ocaml-base-compiler.4.05.0 && \
  opam switch create 4.06 ocaml-base-compiler.4.06.1 && \
  opam switch create 4.07 ocaml-base-compiler.4.07.1 && \
  opam switch 4.07
ENTRYPOINT [ "opam", "config", "exec", "--" ]
RUN opam install -y depext
ENV OPAMYES 1
CMD bash
ADD ocaml-amd64/Dockerfile.debian-9 /Dockerfile

or for the version-specific variants:

$ docker run ocaml/opam2:4.07 cat /Dockerfile
# Autogenerated by OCaml-Dockerfile scripts
FROM ocaml/opam2:debian-9-opam
WORKDIR /home/opam/opam-repository
RUN opam-sandbox-disable && \
  opam init -k git -a /home/opam/opam-repository --bare && \
  opam switch create 4.07 ocaml-base-compiler.4.07.1 && \
  opam switch create 4.07+afl ocaml-variants.4.07.1+afl && \
  opam switch create 4.07+flambda ocaml-variants.4.07.1+flambda && \
  opam switch create 4.07+default-unsafe-string ocaml-variants.4.07.1+default-unsafe-string && \
  opam switch create 4.07+force-safe-string ocaml-variants.4.07.1+force-safe-string && \
  opam switch 4.07 && \
  opam install -y depext
ENV OPAMYES 1
ENTRYPOINT [ "opam", "config", "exec", "--" ]
CMD bash
ADD ocaml-amd64/Dockerfile.debian-9-ocaml-4.07 /Dockerfile

They are generated using the obi-gitlab command line tool from the https://github.com/ocaml/obi repository, and are triggered from CI via a GitLab Pipelines setup.