Does anybody ships OCaml software to end users/customers using containers/docker?


Is it easy to ship OCaml software to end users using docker or the like?

I wonder if it is not a better solution than creating self-extracting archives
using opam-bundle.

Especially, I wonder if it would not be faster for end users.
Since installing an opam-bundle is time consuming and not
totally fail-safe (for example because of system dependencies
that need to be installed, but may fail to do so).

Thanks for any feedback on this,

I would guess it depends on the end users, esp. of their operating system. I would guess opam is still easier for mac users while docker would be easier for latest windows users.
Also these days I would consider nix, that would work similarly in linux and macos (and not at all on windows).

I do. Though I recently met a lot of various problems considering use of the modern OCaml versions. Gladly, they all are fixed now. I base my containers on a multistage build images, using Alpine Linux, and then copy the statically-built files. To save some precious bytes (and CPU usage) you can also build a static binaries inside these Alpine Linux containers and just copy the resulting binary out of the container. I do so in some cases.

Apart from Nix you might also consider Guix, see for example, their new guix deploy feature.

In some discussion before I wrote a few benefits of Guix compared to Nix: