apt-get
and install_packages
with balenalib/rpi-raspbian
images seem to be broken on Apple Silicon. It works fine on Intel (macOS).
I logged a bug "Unknown error executing apt-key" on Apple Silicon · Issue #109 · balena-io-library/resin-rpi-raspbian · GitHub but nobody seems to be paying attention there.
In short:
Doesn’t work on Apple Silicon:
% docker run --platform linux/arm/v6 balenalib/rpi-raspbian:latest apt-get update -y
Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.7 kB]
Get:2 http://archive.raspbian.org/raspbian buster InRelease [15.0 kB]
Err:1 http://archive.raspberrypi.org/debian buster InRelease
Unknown error executing apt-key
[snip]
% docker run --platform linux/arm/v6 balenalib/rpi-raspbian:latest apt-key exportall
Warning: apt-key output should not be parsed (stdout is not a terminal)
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Illegal instruction
% uname -m
arm64
Works on Intel (macOS):
% docker run --platform linux/arm/v6 balenalib/rpi-raspbian:latest apt-get update -y
Get:1 http://archive.raspbian.org/raspbian buster InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian buster InRelease [32.7 kB]
Get:3 http://archive.raspbian.org/raspbian buster/main armhf Packages [18.3 MB]
Get:4 http://archive.raspbian.org/raspbian buster/firmware armhf Packages [1201 B]
Get:5 http://archive.raspbian.org/raspbian buster/non-free armhf Packages [126 kB]
Get:6 http://archive.raspbian.org/raspbian buster/contrib armhf Packages [68.6 kB]
Get:7 http://archive.raspbian.org/raspbian buster/rpi armhf Packages [1299 B]
Get:8 http://archive.raspberrypi.org/debian buster/main armhf Packages [376 kB]
Fetched 18.9 MB in 7s (2638 kB/s)
Reading package lists...
[snip]
% uname -m
x86_64
Any ideas for a workaround? This is a blocker for doing Balena local builds and using local mode.