ocurrent / docker-base-images

Generate various Docker ocaml images
https://images.ci.ocaml.org
MIT License
29 stars 19 forks source link

Switching images to opam 2.1 by default #132

Open dra27 opened 3 years ago

dra27 commented 3 years ago

This presently blocked on the opam depext part, since there's no compatibility for previous versions. Switching to opam 2.1 will expose some uses to problems with opam's integrated depext on certain platforms.

I propose set-opam-version.sh does a re-init for consistency: it only does fractionally more than opam update would, but it's a more consistent thing to do when downgrading from 2.1 to 2.0.

reynir commented 2 years ago

Are there any updates on this? Since mirage 4 requires opam-version >= 2.1.0 this would be very convenient :-)

reynir commented 2 years ago

Ah, I see in #131 that /usr/bin/opam-2.1 is provided. Maybe the docker hub page can be updated to reflect this? Currently it claims the images come with the latest release of opam.

reynir commented 2 years ago

FWIW mirage expects opam in $PATH to be opam 2.1. Copying opam-2.1 to /usr/local/bin/opam works around this.

kit-ty-kate commented 2 years ago

yes, most of our CI projects start with:

FROM ocaml/opam:<tag>
RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam
RUN opam init --reinit -ni
tmcgilchrist commented 11 months ago

There is also a dev version of opam available if you do this:

FROM ocaml/opam:<tag>
RUN ln -f ~/local/bin/opam-dev ~/local/bin/opam
RUN opam init --reinit -ni
hannesm commented 13 hours ago

A year later, could opam 2.2 be used by default? Or is the "do some ln -f" still the suggested modus operandi?

tmcgilchrist commented 11 hours ago

Doing sudo ln -f /usr/bin/opam-2.2 /usr/bin/opam && opam init --reinit -ni still works and most of our services are doing that. I see less value in keeping opam 2.0 and even 2.1 around now that 2.2 supports all the platforms we need. I don't think anyone is deliberately using earlier opam versions. @shonfeder