Bring your team's OCaml CI jobs down to 1 min.
The goal is to set up a cached build environment on which your team can compile and test their own OCaml software, quickly every time.
- Pre-install all the external dependencies - opam packages and more.
- Start from the base Docker image of your choice.
- It's admin-friendly. Maintenance requires no OCaml knowledge.
- Customize by forking and editing this git repo.
- It's Docker. Reproducible locally and not tied to a CI vendor's caching.
For evaluation purposes, you can simply run make
and watch
an image being built with some default settings.
For actual use, follow these steps:
- Create your own Docker repository on Docker Hub or some other registry.
- Fork this git repository.
- Add packages to the lists in
common-config.sh
. - Create or edit one configuration file per container, in
configs/
. - Adjust the
SELECTED_CONFIGS
variable in theMakefile
. - Run
make
to build the Docker images. - Run
make push
to upload the images. - Use these images as base images in your CI jobs.
You can reuse and adapt the CircleCI config of this repo to rebuild your images on a weekly basis or so.
The config I use for my own needs is common-config.sh and configs. The Docker images end up on Docker Hub: minimum OCaml version and latest OCaml. They are updated weekly using CircleCI (config).
- If you're an individual open-source developer, you may want to target two versions of OCaml: the minimum version that you're willing to support and the latest version.
- The ocaml/opam2 images already support many flavors of operating systems and are graciously maintained for you. You probably should use those if the speed of routine CI builds isn't a priority for you.