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

Dockerfile apt dependency gcc-9-multilib does not exist for aarch64 host (Mac M1) #13

Open
mrlnc opened this issue Sep 16, 2022 · 1 comment

Comments

@mrlnc
Copy link

mrlnc commented Sep 16, 2022

Building the Docker image fails on aarch64 Ubuntu (VM on M1 macbook). Seems at least one package is unavailable for aarch64:

#5 35.68 E: Unable to locate package gcc-9-multilib

I was able to build the image when explicitly requesting the amd64 base image (seems to use some integrated emulation then?).

diff --git a/Dockerfile b/Dockerfile
index 3e6a2d4..e9b4ded 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM amd64/ubuntu:20.04
 LABEL "about"="FirmWire base img"
 
 ARG DEBIAN_FRONTEND=noninteractive

Am I doing something wrong here, or is there an easy fix besides emulation? I'm not sure if the resulting image works 100%, but at least the firmware does seem to come up and do its thing :-)

$ uname -a 
Linux ubuntu-parallels 5.15.0-47-generic #51-Ubuntu SMP Fri Aug 12 08:18:32 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
$ docker run --rm -it -v $(pwd):/firmwire firmwire
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
root@3630e1d821d9:/firmwire# uname -a
Linux 3630e1d821d9 5.15.0-47-generic #51-Ubuntu SMP Fri Aug 12 08:18:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

I thought I'd be best to share this in an issue in case others are trying the same.

@grant-h
Copy link
Contributor

grant-h commented Sep 19, 2022

Thank you for opening an issue! I believe the gcc-9-multilib metapackage does not have an arm64 port as seen here even on 22.04 (jammy) https://packages.ubuntu.com/jammy/gcc-9-multilib. In general I was having a lot of trouble with the multilib packaging even when not on a native aarch64 machine. Most of the issues were stemming from this longstanding bug https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1300211 (for arm, but could also apply to mips)

For now I think emulation mode for amd64 will have to suffice but I am worried it could affect your performance (I'm not even sure how the emulation for docker containers works). If an alternate package for gcc-9-multilib could be found that would still allow for the cross-compiler to be installed, then I'd be happy to edit the docker file.

@grant-h grant-h changed the title Build fails on aarch64 Ubuntu Dockerfile apt dependency gcc-9-multilib does not exist for aarch64 host (Mac M1) Sep 19, 2022
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