docker-base-images icon indicating copy to clipboard operation
docker-base-images copied to clipboard

Switching images to opam 2.1 by default

Open dra27 opened this issue 4 years ago • 8 comments

  • [ ] set-opam-version.sh 2.1 added to images. It's just sudo ln -f /usr/bin/opam-$1 /usr/bin/opam && rm -rf ~/.opam && opam init -k local -a /home/opam/opam-repository --bare (with error handling!)
  • [ ] opam-depext needs 2.1 support so that with OPAMCLI=2.0 opam depext package works
  • [ ] Images have ENV OPAMCLI=2.0 and /usr/bin/opam is /usr/bin/opam-2.1 by default. The root is therefore opam 2.1

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.

dra27 avatar Sep 08 '21 09:09 dra27

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

reynir avatar Aug 31 '22 14:08 reynir

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 avatar Aug 31 '22 14:08 reynir

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

reynir avatar Sep 09 '22 10:09 reynir

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

kit-ty-kate avatar Sep 09 '22 10:09 kit-ty-kate

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

tmcgilchrist avatar Nov 22 '23 22:11 tmcgilchrist