Raspberry OS from Raspberry Pi Foundation. Dockerized
283
https://github.com/darkenvy/RaspberryOS-Docker
fdisk -l 2021-05-07-raspios-buster-armhf-lite.img532480x512=272629760sudo mount -o loop,offset=272629760,ro 2021-05-07-raspios-buster-armhf-lite.img /mntsudo tar -C /mnt -c . | docker import - raspberryos-imgsudo docker build --no-cache -t darkenvy/raspberryos:TAGNAME .docker push darkenvy/raspberryos:TAGNAMEdocker image rm raspberryos-imgThe ability to run a ARM container on x64 is not determined by how the docker image is constructed, but instead of how the host-OS is set up. If the host-OS has the ARM header registered in /proc/sys/fs/binfmt_misc, then whenever the kernel comes across a ARM binary, it will search for qemu located at /usr/bin/qemu-arm-static.
If the kernel comes across a ARM binary when operating inside a docker container, then it will look for qemu-arm-static from /usr/bin/qemu-arm-static relative to the docker container. Therefore, each docker container must contain the qemu-arm-static binary.
grep binfmt /proc/mounts
b. cat /proc/sys/fs/binfmt_mist/statusmount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
a. Note: Modern linux distros will have binfmt already enabled.echo 1 > /proc/sys/fs/binfmt_misc/statussudo sh -c "echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register"docker run -it -v $(pwd)/qemu-arm-static:/usr/bin/qemu-arm-static darkenvy/raspberryos /bin/bash
b. Note: If you dont have qemu-arm-static at /usr/bin/qemu-arm-static on the host, then the host will not execute ARM. This is fine and totally Optional.Content type
Image
Digest
Size
422.8 MB
Last updated
about 5 years ago
docker pull darkenvy/raspberryos