Skip to content

Docker build fails on Apple Silicon Mac #53

@zhaoyig

Description

@zhaoyig

Running make system_<system_name> on my M1 Macbook fails with following:

docker build -t effecthandlers/effect-handlers:ocaml systems/ocaml
[+] Building 1.7s (12/20)                                                                       docker:desktop-linux
 => [internal] load .dockerignore                                                                               0.0s
 => => transferring context: 2B                                                                                 0.0s
 => [internal] load build definition from Dockerfile                                                            0.0s
 => => transferring dockerfile: 1.33kB                                                                          0.0s
 => [internal] load metadata for docker.io/library/ubuntu:22.04                                                 1.4s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                   0.0s
 => [ 1/16] FROM docker.io/library/ubuntu:22.04@sha256:2b7412e6465c3c7fc5bb21d3e6f1917c167358449fecac8176c6e49  0.0s
 => CACHED [ 2/16] RUN apt-get update &&     apt-get -y upgrade &&     apt-get install -y     sudo              0.0s
 => CACHED [ 3/16] RUN useradd -ms /bin/bash ubuntu &&     usermod -aG sudo ubuntu                              0.0s
 => CACHED [ 4/16] RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers                                      0.0s
 => CACHED [ 5/16] WORKDIR /home/ubuntu                                                                         0.0s
 => CACHED [ 6/16] RUN sudo apt install -y wget                                                                 0.0s
 => CACHED [ 7/16] RUN wget https://github.com/sharkdp/hyperfine/releases/download/v1.15.0/hyperfine_1.15.0_am  0.0s
 => ERROR [ 8/16] RUN sudo dpkg -i hyperfine_1.15.0_amd64.deb                                                   0.2s
------
 > [ 8/16] RUN sudo dpkg -i hyperfine_1.15.0_amd64.deb:
0.194 dpkg: error processing archive hyperfine_1.15.0_amd64.deb (--install):
0.194  package architecture (amd64) does not match system (arm64)
0.200 Errors were encountered while processing:
0.200  hyperfine_1.15.0_amd64.deb
------
Dockerfile:25
--------------------
  23 |     RUN sudo apt install -y wget
  24 |     RUN wget https://github.com/sharkdp/hyperfine/releases/download/v1.15.0/hyperfine_1.15.0_amd64.deb
  25 | >>> RUN sudo dpkg -i hyperfine_1.15.0_amd64.deb
  26 |
  27 |     # Install Multicore OCaml
--------------------
ERROR: failed to solve: process "/bin/sh -c sudo dpkg -i hyperfine_1.15.0_amd64.deb" did not complete successfully: exit code: 1
make: *** [system_ocaml] Error 1

Changing the amd64 to arm64 in following lines in Dockerfiles solves the problem.

RUN wget https://github.com/sharkdp/hyperfine/releases/download/v1.15.0/hyperfine_1.15.0_amd64.deb
RUN sudo dpkg -i hyperfine_1.15.0_amd64.deb

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions