[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Opam Docker Permissions Issue?

  • To: Compos Min <composmin@xxxxxxxxxxxx>
  • From: Anil Madhavapeddy <anil@xxxxxxxxxx>
  • Date: Mon, 21 Nov 2016 12:34:45 +0000
  • Cc: mirageos-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 21 Nov 2016 12:34:54 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=recoil.org; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= selector1; b=El1JZ36wFYTX9MTEZVqoJS8G8tE+xq51paiFkHiSDcxu5UV08xK r2Gtjfd7rZbxXdaX/ob3ROyDSJ3EpRy8yXn4Oh0lsQ48ruBvGokM10wQ3BXjDp0v U8/SkgPiFAZNfj9N/RYE6OlwfMBvcPMtKI8lw0/Vnfjm0XY019CqwCbg=
  • List-id: Developer list for MirageOS <mirageos-devel.lists.xenproject.org>

> On 9 Nov 2016, at 12:29, Compos Min <composmin@xxxxxxxxxxxx> wrote:
> Hi Folks,
> I've been reading about Mirage for quite a while now and would like to start 
> making
> some contributions (well as much as somebody that is just learning OCaml).
> Unfortunately I'm stuck on build problem with the simple Dockerfile listed on 
> https://github.com/ocaml/opam-dockerfiles.
> FROM ocaml/opam:ubuntu-15.10_ocaml-4.02.3
> RUN opam remote add dev git://github.com/mirage/mirage-dev
> RUN opam depext -i mirage
> The error output is:
> Fatal error:
> # opam-version    1.2.2 (c968888614d3fdbac881d3b7b8ef32ee97839807)
> # os              linux
> opam: "open" failed on /home/opam/.opam/log/command-5-5a61c5.out: Permission 
> denied

Hi Chris,

I've still not fully documented those Dockerfiles are meant to be used as base 
images, so my apologies for that [1].  I ran through yours and hit a few 
issues, so I thought it might be useful to list out what I did while debugging 

- Your Dockerfile uses Ubuntu 15.10 which is no longer maintained, and so the 
OPAM repository in that image has not been successfully rebuilt since Jun16 
[2].  This leads to an outdated opam-repository package set.  How did I 
diagnose this?

  - The symptom of an outdated opam-repository is that "opam depext mirage" 
installed mirage.2.9.0 despite the mirage-dev remote being available.
  - I changed the RUN line to "opam depext -ui mirage.dev~mirage" to force it 
to explicitly install the development version.
  - This resulted in an OPAM constraint error complaining that "topkg>=0.8.0" 
was not a valid package.  Since that has been released in the past few months, 
the missing package indicated that the repository was out of date.

- I changed it to "ocaml/opam:ubuntu-16.04_ocaml-4.02.3" which is the LTS, and 
reran it. This time the OPAM repository was up-to-date, but the development 
version of Mirage now requires 4.03.0 and so compilation failed.
  - Fixing it on 4.02 is fairly low hanging so I submitted a PR [3]
  - We need to be consistent about our decision on the minimum OCaml version [4]

So recommendations right now for the Dockerfile are:

FROM ocaml/opam:ubuntu-16.04_ocaml-4.03.0
RUN opam remote add dev git://github.com/mirage/mirage-dev
RUN cd /home/opam/opam-repository && git pull -u && opam update -uyv
RUN opam depext -uivy mirage.dev~mirage

This will update the OPAM repository, update the revisions to be the very 
latest, and verbosely install external dependencies.  I'll work on documenting 
this properly in [1] for release documentation.

As for your original permissions issue -- I'm not sure :-)  Are you using 
Docker for Mac by any chance?  That does UID rewriting for shared volumes, but 
I'm otherwise not sure how root crept in here. Could you try adding a "USER 
opam" beforehand to make sure this is working ok?

[1] Dockerfile doc tracking issue: https://github.com/mirage/mirage/issues/697
[2] How do we retire old distributions? 
[3] https://github.com/mirage/mirage/pull/695
[4] https://github.com/mirage/mirage/issues/696


MirageOS-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.