On an apple silicon macos, given the following repro.dockerfile
:
FROM ocaml/opam:debian-ocaml-5.1
ENV DEBIAN_FRONTEND=noninteractive
RUN opam install dune.3.16.0 -y
running
docker build -f repro.dockerfile -t debug-dune .
runs successfully
But running the same for platform linux/amd64
:
docker buildx build -f repro.dockerfile --platform linux/amd64 -t debug-dune .
fails:
7.794 <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
12.05 [ERROR] The compilation of dune failed at "/home/opam/.opam/5.1/bin/ocaml boot/bootstrap.ml -j 39".
12.05
12.05 #=== ERROR while compiling dune.3.16.0 ========================================#
12.05 # context 2.0.10 | linux/x86_64 | ocaml-base-compiler.5.1.1 | file:///home/opam/opam-repository
12.05 # path ~/.opam/5.1/.opam-switch/build/dune.3.16.0
12.05 # command ~/.opam/5.1/bin/ocaml boot/bootstrap.ml -j 39
12.05 # exit-code 255
12.05 # env-file ~/.opam/log/dune-7-60459a.env
12.05 # output-file ~/.opam/log/dune-7-60459a.out
12.05 ### output ###
12.05 # ocamlc -output-complete-exe -w -24 -g -o .duneboot.exe -I boot -I +unix unix.cma boot/libs.ml boot/duneboot.ml
12.05 # ./.duneboot.exe -j 39
12.05 # cd _boot && /home/opam/.opam/5.1/bin/ocamlopt.opt -c -g -no-alias-deps -w -49-6 -alert -unstable -I +unix -I +threads opamLineLexer.ml
12.05 #
12.05
12.05
12.05
12.05 <><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
12.05 +- The following actions failed
12.05 | - build dune 3.16.0
12.05 +-
12.05 - No changes have been performed
My goal is to build an application on an arm mac, so it works on amd64 debian.
Any idea why installing dune specifically might not work? Running opam install ...
for packages works