Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some packages fail to download on arm64 (Docker Desktop multi-arch build) #108

Open
ozanmakes opened this issue May 10, 2021 · 1 comment

Comments

@ozanmakes
Copy link

ozanmakes commented May 10, 2021

I am trying to build arm64 docker images with Docker Desktop on macOS and seeing some packages fail to download during installation.

$ echo "FROM ocaml/opam:ubuntu-20.10-ocaml-4.12\nRUN opam install astring" > Dockerfile
$ docker buildx build --platform linux/arm64 .

Output:

...
------
 > [2/2] RUN opam install astring:
#6 19.53 The following actions will be performed:
#6 19.53   - install ocamlfind  1.9.1  [required by astring]
#6 19.53   - install ocamlbuild 0.14.0 [required by astring]
#6 19.53   - install topkg      1.0.3  [required by astring]
#6 19.53   - install astring    0.8.5
#6 19.53 ===== 4 to install =====
#6 19.54
#6 19.54 <><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
#6 20.40 [ocamlfind.1.9.1] downloaded from http://download.camlcity.org/download/findlib-1.9.1.tar.gz
#6 21.11 [ocamlbuild.0.14.0] downloaded from https://github.com/ocaml/ocamlbuild/archive/0.14.0.tar.gz
#6 21.56 [ERROR] The sources of the following couldn't be obtained, aborting:
#6 21.56           - astring.0.8.5: Curl failed
#6 21.56           - topkg.1.0.3: Curl failed
#6 21.56
------
Dockerfile:2
--------------------
   1 |     FROM ocaml/opam:ubuntu-20.10-ocaml-4.12
   2 | >>> RUN opam install astring
   3 |
--------------------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c opam install astring]: exit code: 40

To try this you'd need to create a builder following the example here: https://www.docker.com/blog/multi-arch-images/

Wget also fails for the same packages when I do RUN echo 'download-command: wget' >> $HOME/.opam/config.

Most of my apps dependencies do get installed, with a certain subset always failing to download: topkg astring rresult fmt logs fpath bos cmdliner reason. Releases for all of these except Reason are hosted on the same server, erratique.ch, which might be a clue. My current workaround is to run opam pin add --dev <package> for each one of these before I call opam install --deps-only . in my build.

Apologies if this is the wrong place to report this.

@talex5
Copy link
Contributor

talex5 commented May 10, 2021

I think opam has a cache that it can use if the main download site is down (archive-mirrors?), but I don't know how to turn it on. Maybe @kit-ty-kate knows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants