Giter Club home page Giter Club logo

dockerpi's Introduction

dockerpi

Docker Pulls Docker Image Size GitHub Donate Bitcoin Donate Lightning Donate

A Virtualised Raspberry Pi inside a Docker image

Gives you access to a virtualised ARM based Raspberry Pi machine running the Raspian operating system.

This is not just a Raspian Docker image, it's a full ARM based Raspberry Pi virtual machine environment.

Usage

docker run -it lukechilds/dockerpi

By default all filesystem changes will be lost on shutdown. You can persist filesystem changes between reboots by mounting the /sdcard volume on your host:

docker run -it -v $HOME/.dockerpi:/sdcard lukechilds/dockerpi

If you have a specific image you want to mount you can mount it at /sdcard/filesystem.img:

docker run -it -v /2019-09-26-raspbian-buster-lite.img:/sdcard/filesystem.img lukechilds/dockerpi

If you only want to mount your own image, you can download a much slimmer VM only Docker container that doesn't contain the Raspbian filesystem image:

Docker Image Size Docker Image Size

docker run -it -v /2019-09-26-raspbian-buster-lite.img:/sdcard/filesystem.img lukechilds/dockerpi:vm

Which machines are supported?

By default a Raspberry Pi 1 is virtualised, however experimental support has been added for Pi 2 and Pi 3 machines.

You can specify a machine by passing the name as a CLI argument:

docker run -it lukechilds/dockerpi pi1
docker run -it lukechilds/dockerpi pi2
docker run -it lukechilds/dockerpi pi3

Note: In the Pi 2 and Pi 3 machines, QEMU hangs once the machines are powered down requiring you to docker kill the container. See #4 for details.

Wait, what?

A full ARM environment is created by using Docker to bootstrap a QEMU virtual machine. The Docker QEMU process virtualises a machine with a single core ARM11 CPU and 256MB RAM, just like the Raspberry Pi. The official Raspbian image is mounted and booted along with a modified QEMU compatible kernel.

You'll see the entire boot process logged to your TTY until you're prompted to log in with the username/password pi/raspberry.

pi@raspberrypi:~$ uname -a
Linux raspberrypi 4.19.50+ #1 Tue Nov 26 01:49:16 CET 2019 armv6l GNU/Linux
pi@raspberrypi:~$ cat /etc/os-release | head -n 1
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
pi@raspberrypi:~$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 798.31
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : ARM-Versatile (Device Tree Support)
Revision        : 0000
Serial          : 0000000000000000
pi@raspberrypi:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:          246Mi        20Mi       181Mi       1.0Mi        44Mi       179Mi
Swap:          99Mi          0B        99Mi

Build

Build this image yourself by checking out this repo, cd ing into it and running:

docker build -t lukechilds/dockerpi .

Build the VM only image with:

docker build -t lukechilds/dockerpi:vm --target dockerpi-vm .

Credit

Thanks to @dhruvvyas90 for his dhruvvyas90/qemu-rpi-kernel repo.

License

MIT ยฉ Luke Childs

dockerpi's People

Contributors

hardillb avatar jamesreynolds avatar lukechilds avatar mrtwnklr avatar svenluijten avatar tkeemon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dockerpi's Issues

Slow Internet speed

Hello,
I'm running a Raspian in Dockerpi:

docker run -it --sysctl net.ipv4.ping_group_range="0 2147483647" -v /2020-02-13-raspbian-buster-lite.img:/sdcard/filesystem.img lukechilds/dockerpi:vm

I'm getting very slow internet speed inside. For example cloning with git:

git clone XXX
...
receiving objects:  49% (573/1155), 34.26 MiB | 123.00 KiB/s

This is confirmed by a speed test:

pi@raspberrypi:~$ curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
Retrieving speedtest.net configuration...
Testing from AGSM Lighting SRL (213.171.98.58)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Prometeus di Daniela Agro (Cologno Monzese) [133.57 km]: 21.552 ms
Testing download speed................................................................................
Download: 9.34 Mbit/s
Testing upload speed................................................................................................
Upload: 26.43 Mbit/s

On the host, I get speeds that are 10X-40X more.

Can't log in

After I download and start the image docker run lukechilds/dockerpi I get prompted to enter username/password.

After I enter pi the container freezes.

I already waited for a few minutes because I thought the SSH keygen takes so long but it still didn't respond after +5mins.

After I press ctrl+c it shows me qemu-system-arm: terminating on signal 2 sometimes also qemu-system-arm: terminating on signal 2

odd behavior exposing ssh login port?

using the buster lite image, I configured the ssh service to auto start with systemctl enable ssh.service

However, when trying to connect from a ssh client, I kept getting:

ssh -p 5022 [email protected]
kex_exchange_identification: read: Connection reset by peer
Connection reset by 127.0.0.1 port 5022

The only way i could connect was by adding network_mode: host to my docker compose file, even though docker says published ports are ignored in host mode.

Here is my docker compose file:

dockerpi:
image: lukechilds/dockerpi:vm
container_name: dockerpi
command: pi3
environment:
- PUID=1000
- PGID=1000
- TZ=America/Phoenix
volumes:
- /home/jsauer/docker/appdata/dockerpi/buster_filesystem.img:/sdcard/filesystem.img
network_mode: host
ports:
- 5022:22/tcp
restart: unless-stopped

Disk Size Limitations?

Currently attempting to use this to build golden images from an ansible script, but I found myself running out of disk space.

Using the last 2020 February raspbian release image.

I expanded my image and expanded the root partition, and everything is showing up correctly on inspection of it. When I run the pi /dev/sda shows as 3 GB, instead of what it previously was, and /dev/sda2 shows up properly expanded at 2.8 GB. However, when I run df -h I see /dev/root is mounted to /, not /dev/sda2, and it is only 1.5 GB. On inspection, the file /dev/root does not exist. Looking into this, it looks like an artifact of qemu. Looking at the entrypoint script, I don't see any reason the root partition size would be arbitrarily limited to 1.5GB and not match the size it sees of /dev/sda2. This doesn't make any sense to me, and I was wondering if any experience anyone has had with this can explain what needs to happen to expand the raspbian image size and have the system actually pick it up when running.
brokenpidisk

Various and different bugs inside the entrypoint.sh file and or dockerfile

My goal is to enable the persistent data storage using a bigger raspbian buster image file. This is what I did :

  1. qemu-img resize 2019-09-26-raspbian-buster-lite.img 32G
  2. zip 2019-09-26-raspbian-buster-lite.zip 2019-09-26-raspbian-buster-lite.img

at this point,I realized that for some unknown reason,the zipped file wasn't decompressed correctly by the zip utility,which gives a generic unzip extraction error. So,I've thought to use tar and the error is gone. So we can jump to step 3 :

  1. tar -czvf 2019-09-26-raspbian-buster-lite.tar.gz 2019-09-26-raspbian-buster-lite.img

So,now I had to modify slightly Dockerfile and entrypoint.sh files like this :

  1. entrypoint.sh :
#!/bin/sh

GIB_IN_BYTES="1073741824"

target="${1:-pi1}"
image_path="/sdcard/filesystem.img"
zip_path="/filesystem.tar.gz"

if [ ! -e $image_path ]; then
#  echo "No filesystem detected at ${image_path}!"
   if [ -e $zip_path ]; then
      echo "Extracting fresh filesystem..."
    # unzip $zip_path
      tar -xzvf $zip_path
      mv *.img $image_path
  else
    exit 1
  fi
fi
  1. Dockerfile :
FROM dockerpi-vm as dockerpi

ARG FILESYSTEM_IMAGE_URL="http://ziomario.ns0.it/2019-09-26-raspbian-buster-lite.tar.gz"
ADD $FILESYSTEM_IMAGE_URL /filesystem.tar.gz

But as I said at the beginning,I wanted to have persistent data storage,but only for the VM model 3,the one with the parameter "machine=raspi3b". I realized that starting the container like this :

-v $HOME/.dockerpi:/sdcard lukechilds/dockerpi

it enables the persistence of the datas only for the VM model 1,the one with the paramter "machine=versatilepb" but I'm not interested to it AND if I start the VM like this :

-v $HOME/.dockerpi:/sdcard lukechilds/dockerpi pi3

it is not supported. It doesn't even enable the persistence for the VM model 3,but only for the model 1. So,let's jump to point 6)

  1. I have modified again the entrypoint.sh script like this :
if [ "${target}" = "pi3" ]; then
  emulator=qemu-system-arm
  kernel="/root/qemu-rpi-kernel/kernel-qemu-4.19.50-buster"
  dtb="/root/qemu-rpi-kernel/versatile-pb.dtb"
  machine=versatilepb
  memory=256m
  root=/dev/sda2
  nic="--net nic --net user,hostfwd=tcp::5022-:22"
elif [ "${target}" = "pi2" ]; then
  emulator=qemu-system-arm
  machine=raspi2b
  memory=1024m
  kernel_pattern=kernel7.img
  dtb_pattern=bcm2709-rpi-2-b.dtb
  append="dwc_otg.fiq_fsm_enable=0"
  nic="-netdev user,id=net0,hostfwd=tcp::5022-:22 -device usb-net,netdev=net0"
elif [ "${target}" = "pi1" ]; then
  emulator=qemu-system-aarch64
  machine=raspi3b
  memory=1024m
  memory=1024m
  kernel_pattern=kernel8.img
  dtb_pattern=bcm2710-rpi-3-b-plus.dtb
  append="dwc_otg.fiq_fsm_enable=0"
  nic="-netdev user,id=net0,hostfwd=tcp::5022-:22 -device usb-net,netdev=net0"
else
  echo "Target ${target} not supported"
  echo "Supported targets: pi1 pi2 pi3"
  exit 2
fi

and finally,point 7 :

  1. I can start the container with this start.sh script :
!/bin/bash
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -

docker run \
        -it \
        -v $XSOCK:$XSOCK:rw \
        -v $XAUTH:$XAUTH:rw \
        -e DISPLAY=$DISPLAY \
        -e XAUTHORITY=$XAUTH \
        -v $HOME/.dockerpi:/sdcard lukechilds/dockerpi
  1. and now,after having did all of this,I get the following error when it decompress the tar.gz image file :

Screenshot_2021-06-06_00-19-24

mapping the /dev/snd to pass through sound

thx for this useful container
I'm trying to get it to connect to the actual host-speakers to play around with the sound.

I was hoping the trick in https://stackoverflow.com/questions/28985714/run-apps-using-audio-in-a-docker-container would help me

Launching with

$ docker run -ti --rm -v /dev/snd:/dev/snd --privileged lukechilds/dockerpi 

however still produces

pi@raspberrypi$ ls /dev/snd/*
ls: cannot access '/dev/snd/*': No such file or directory

any tips?

Improve Qemu parameters (nice thing to have)

It would be much better if user could replace the default Qemu parameters in entrypoint.sh, i.e. if I define "nic" environment variable via docker container run, entrypoint.sh should override the default "nic"...

building image on aarch64

Hey,

I'm trying to build this image for aarch64 instead of the provided x86. I tried on Pine64's RockPro64 and Mac Mini M1 and both result in the following build error of qemu. I tried building the image on x86, but that works without issue.

#26 650.1 [1710/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/meson-generated_.._qapi_qapi-commands-machine-target.c.o
#26 651.0 [1711/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/target_arm_arm-powerctl.c.o
#26 651.6 [1712/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/target_arm_machine.c.o
#26 652.6 [1713/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_highbank.c.o
#26 653.0 [1714/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_exynos4210.c.o
#26 653.9 [1715/2814] Linking target qemu-img
#26 653.9 /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/10/../../../aarch64-linux-gnu/libglib-2.0.a(gutils.c.o): in function `g_get_user_database_entry':
#26 653.9 (.text+0x27c): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 653.9 /usr/bin/ld: (.text+0xe8): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 653.9 /usr/bin/ld: (.text+0x11c): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 653.9 /usr/bin/ld: libio.fa(io_dns-resolver.c.o): in function `qio_dns_resolver_lookup_sync_inet':
#26 653.9 /qemu/qemu-6.0.0/io/dns-resolver.c:90: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 654.4 [1716/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_npcm7xx_boards.c.o
#26 655.4 [1717/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_sbsa-ref.c.o
#26 655.5 [1718/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_palm.c.o
#26 656.1 [1719/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_omap2.c.o
#26 656.4 [1720/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_sysbus-fdt.c.o
#26 657.9 [1721/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_msf2-soc.c.o
#26 658.4 [1722/2814] Linking target qemu-system-arm
#26 658.4 FAILED: qemu-system-arm 
#26 658.4 c++ @qemu-system-arm.rsp
#26 658.4 /usr/bin/ld: libblockdev.fa(os-posix.c.o): in function `change_process_uid':
#26 658.4 /qemu/qemu-6.0.0/os-posix.c:183: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 658.4 /usr/bin/ld: libblockdev.fa(os-posix.c.o): in function `os_parse_cmd_args':
#26 658.4 /qemu/qemu-6.0.0/os-posix.c:137: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 658.4 /usr/bin/ld: libcommon.fa.p/net_slirp.c.o: in function `slirp_smb':
#26 658.4 /qemu/qemu-6.0.0/net/slirp.c:827: warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 658.4 /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/10/../../../aarch64-linux-gnu/libglib-2.0.a(gutils.c.o): in function `g_get_user_database_entry':
#26 658.4 (.text+0xe8): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 658.4 /usr/bin/ld: (.text+0x11c): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 658.4 /usr/bin/ld: libcommon.fa.p/net_l2tpv3.c.o: in function `net_init_l2tpv3':
#26 658.4 /qemu/qemu-6.0.0/net/l2tpv3.c:640: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 658.4 /usr/bin/ld: libcommon.fa.p/net_net.c.o: in function `parse_host_port':
#26 658.4 /qemu/qemu-6.0.0/net/net.c:102: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
#26 658.4 /usr/lib/gcc/aarch64-linux-gnu/10/../../../aarch64-linux-gnu/libc.a(init-first.o): in function `__libc_init_first':
#26 658.4 (.text+0x80): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol `_dl_fpu_control' defined in .bss section in /usr/lib/gcc/aarch64-linux-gnu/10/../../../aarch64-linux-gnu/libc.a(dl-support.o)
#26 658.4 /usr/bin/ld: (.text+0x80): warning: too many GOT entries for -fpic, please recompile with -fPIC
#26 658.4 collect2: error: ld returned 1 exit status
#26 658.6 [1723/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_strongarm.c.o
#26 658.6 [1724/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_spitz.c.o
#26 659.0 [1725/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_fsl-imx6.c.o
#26 659.5 [1726/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_musca.c.o
#26 660.5 [1727/2814] Compiling C object libqemu-aarch64-softmmu.fa.p/hw_arm_fsl-imx7.c.o
#26 660.5 ninja: build stopped: subcommand failed.
#26 660.5 make: *** [Makefile:152: run-ninja] Error 1
------
error: failed to solve: executor failed running [/bin/sh -c make -j$(nproc)]: exit code: 2

Default disk space is too small?

Hi, I'm new to docker and qemu, so I maybe missing something. When I follow your install instructions, specifically docker run -it lukechilds/dockerpi, and log into the Rpi, there is a very small disk space:

pi@raspberrypi:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       1.8G  1.2G  533M  69% /
devtmpfs        124M     0  124M   0% /dev
tmpfs           124M     0  124M   0% /dev/shm
tmpfs           124M  1.9M  122M   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           124M     0  124M   0% /sys/fs/cgroup
/dev/sda1       253M   52M  201M  21% /boot
tmpfs            25M     0   25M   0% /run/user/1000

How can I give move space to the Rpi? I saw #18, but I don't understand how that solution is implemented.

Automate login and script in container

Hi,

I would like to automate the login and run stuff automated in the container.
However, I'm not exactly sure how.
I would be grateful if you can point me in the right direction!

Thanks for you help!

extend memory size

Is there any to extend memory usage ?
256MB RAM is not enough to install perl CGI module.
I built the image and change entrypoint.sh .Then started a container.

steven@ng4:~/dockerpi$ docker run -it lukechilds/dockerpi
No filesystem detected at /sdcard/filesystem.img!
Extracting fresh filesystem...
Archive: /filesystem.zip
inflating: 2019-09-26-raspbian-buster-lite.img
Booting QEMU machine "versatilepb" with kernel=/root/qemu-rpi-kernel/kernel-qemu-4.19.50-buster dtb=/root/qemu-rpi-kernel/versatile-pb.dtb
qemu-system-arm: versatilepb: memory size must not exceed 256MB

bind-mount not working?

I'm trying to use a bind mount to access the host filesystem from within the emulated environment.

I added "--mount type=bind,source=/path/to/host/folder,target=/host_folder" to my command line. Docker Hub is showing the mount when I inspect the running instance. The host folder does exist. No errors about the bind can be seen during startup. However, the "/host_folder" target is not showing NOT show up inside the emulated system.

The host is MacOS 10.15.4

Is this supported? If so, what am I doing wrong?

How to use 64bit kernel?

Hi,

I would like to compile with an aarch64 kernel using this project.
Can you point me in the right direction?

Thanks for your help!

Append New Port Forwarding

Not exactly an issue,

but I did not found any proper explanation here to enable custom port forwarding from inside the qemu emulator.
So I decided to host this issue, if anyone wants to accomplish the same task.

To append a new port just add the following in the nic line of the entrypoint.sh file

,hostfwd=tcp::8000-:8000

and rebuild the container from the repository.

Cheers,

Luke

Ubuntu 20.04 LTS doesent load on vm.

Image get from official source: https://ubuntu.com/download/raspberry-pi/thank-you?version=20.04.4&architecture=server-arm64+raspi

command:
docker run -it -v :/sdcard/filesystem.img lukechilds/dockerpi:vm

output:
request_module: kmod_concurrent_max (0) close to 0 (max_modprobes: 50), for module binfmt-464c, throttlirequest_module: modprobe binfmt-464c cannot be processed, kmod busy with 50 threads for more than 5 seconds now
Starting init: /sbin/init exists but couldn't execute it (error -8)
Run /etc/init as init process
Run /bin/init as init process
Run /bin/sh as init process
request_module: kmod_concurrent_max (0) close to 0 (max_modprobes: 50), for module binfmt-464c, throttling...
request_module: modprobe binfmt-464c cannot be processed, kmod busy with 50 threads for more than 5 seconds now
Starting init: /bin/sh exists but couldn't execute it (error -8)
Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.50+ #1
Hardware name: ARM-Versatile (Device Tree Support)
[] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[] (show_stack) from [] (panic+0xc8/0x240)
[] (panic) from [] (kernel_init+0xb8/0xe8)
[] (kernel_init) from [] (ret_from_fork+0x14/0x2c)
Exception stack(0xcf823fb0 to 0xcf823ff8)
3fa0: 00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
Rebooting in 1 seconds..

When pass pi3 as arg:
image: /sdcard/filesystem.img
file format: raw
virtual size: 4 GiB (4294967296 bytes)
disk size: 4 GiB
Extracting partitions
dd: invalid number '1023,3,32'
Extracting boot filesystem
Error: ! Unable to open the input file: /fat.img for reading
Searching for kernel='kernel8.img'
Searching for dtb='bcm2710-rpi-3-b-plus.dtb'
Missing kernel='' or dtb=''

trying to add to dockerpi a better network stack...ERROR internal error: Unexpected enum value 0 for virDomainDeviceAddressType

Hello. I'm trying to provide to dockerpi a better network stack than this :

nic="-netdev user,id=net0,hostfwd=tcp::5022-:22 -device usb-net,netdev=net0"

because this kind of network has limitations,infact the network is not reachable from outside,because it does not assign a real IP number. So I would like to add inside the dockerpi container a code like this :

virt-install
--name pi
--machine raspi3
--cpu arm1176
--memory 1024
--import
--disk /root/Desktop/zi/Work/Android/Raspy/Debian/2019-09-26-raspbian-buster-lite.img,format=raw,bus=virtio
--network user,model=virtio
--video vga
--graphics spice
--rng device=/dev/urandom,model=virtio
--boot 'uefi=RPI_EFI.fd,dtb=bcm2710-rpi-3-b-plus.dtb,kernel=kernel8.img,kernel_args=root=/dev/vda2 rootwait panic=1 dwc_otg.fiq_fsm_enable=0'
--events on_reboot=destroy

unfortunately I get this error :

Unexpected enum value 0 for virDomainDeviceAddressType

I've got the UEFI BIOS file from here :

https://github.com/andreiw/RaspberryPiPkg/blob/master/Binary/prebuilt/2019Jan16-GCC5/RELEASE/RPI_EFI.fd

anyway I think that it can be done.

Can it be used to build Raspbian images?

First, thanks for this amazing work ! ๐Ÿ‘

I'm the founder of Gladys Assistant, it's an open-source home automation software which runs on a Raspberry Pi.

We distribute to our users a Raspbian image with Gladys pre-installed on it, and for now we build this image manually (we clone an empty raspbian on an ARMv6 Pi, then install Gladys, then backup the image and distribute the .img)

Does your Docker image can be used to build a .img file without having to use a Raspberry Pi?

If yes, it's just amazing!

Btw, I just saw that you are working full-time on open-source and you're digital-nomad. I'm DN as well, and working part-time on open-source. Would love to chat with you, I followed you on Twitter, I'm @pierregillesl.

Map files into boot folder

Is it possible to map files (e.g. wpa_supplicant.conf, config.txt, dietpi.txt,...) into the boot folder of the filesystem through the Dockerfile or the docker-compose file?

I'm trying to run DietPi with this image and I would like to enable the auto setup through the dietpi.txt file.
I've tried with the following docker-compose.yml but the OS starts normally without triggering the auto setup procedure.

services:
  dockerpi:
    image: lukechilds/dockerpi:vm
    volumes:
      - ./dietpi/DietPi_RPi-ARMv6-Buster.img:/sdcard/filesystem.img
      - ./dietpi/dietpi.txt:/sdcard/boot/dietpi.txt

Automatically testing cross-compiled code with this qemu approach

I am wondering if it is feasible to run test suites for cross-compiled binaries and installers in the future.
I am currently developing the ProxySuite which has an installer for the raspbian/raspios armhf images.

I would like to add a GitHub workflow which spins up a dockerpi qemu emulator, runs the installer inside, and checks if everything is correctly linked and the binary is loadable. That way, I could make sure that the installer works correctly and the cross-compiled binary is probably runnable on a real pi once installed.

What are your thoughts on this approach?
Is something like executing scripts inside already running qemu machines and getting back the return code on the roadmap upstream?

Unable to build Dockerfile in GitHub Codespaces

I was trying to build this environment in GitHub Codespaces so that students can try playing around with ARM Assembly using the Raspberry Pi environment.

For now, I had put in the devcontainer.json file to build from the Dockerfile and work from there.
But while doing so, it cannot build the file and I get the below error message:
then it proceeds to create a recovery container:

------
 > [qemu-builder 15/23] RUN tar xvf "qemu-6.0.0.tar.xz":
0.847 tar (child): xz: Cannot exec: No such file or directory
0.847 tar (child): Error is not recoverable: exiting now
0.847 tar: Child returned status 2
0.847 tar: Error is not recoverable: exiting now
------
ERROR: failed to solve: executor failed running [/bin/sh -c tar xvf "${QEMU_TARBALL}"]: exit code: 2
{"outcome":"error","message":"Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.48.0-1688970082510/Dockerfile-with-features -t vsc-f28hs-rpi-env-fb1a59bfba981cdf651ee18b7c1c47d92b9b65e9380c0ef9f52bc6dee7ff8d9c --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dockerpi /var/lib/docker/codespacemount/workspace/F28HS-RPi-Env/.devcontainer","description":"An error occurred building the image."}
[78009 ms] Stop: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.48.0-1688970082510/Dockerfile-with-features -t vsc-f28hs-rpi-env-fb1a59bfba981cdf651ee18b7c1c47d92b9b65e9380c0ef9f52bc6dee7ff8d9c --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dockerpi /var/lib/docker/codespacemount/workspace/F28HS-RPi-Env/.devcontainer
Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.48.0-1688970082510/Dockerfile-with-features -t vsc-f28hs-rpi-env-fb1a59bfba981cdf651ee18b7c1c47d92b9b65e9380c0ef9f52bc6dee7ff8d9c --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dockerpi /var/lib/docker/codespacemount/workspace/F28HS-RPi-Env/.devcontainer
    at Mte (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2008:1698)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async cC (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2007:1691)
    at async e3 (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2007:610)
    at async Qte (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2024:3660)
    at async Kf (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2024:4775)
    at async xne (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2156:12125)
    at async wne (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2156:11866)
Failed to create container.
Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.48.0-1688970082510/Dockerfile-with-features -t vsc-f28hs-rpi-env-fb1a59bfba981cdf651ee18b7c1c47d92b9b65e9380c0ef9f52bc6dee7ff8d9c --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dockerpi /var/lib/docker/codespacemount/workspace/F28HS-RPi-Env/.devcontainer
Error Code: 1302
Container creation failed.

Could you suggest how to approach this issue and how it can be resolved?
This repo will be greatly beneficial for students who want to learn ARM Assembly and learn to use it properly.

[rpi2] ArchARM with VM image: cannot ping 8.8.8.8

I build an image for Arch ARM (custom-pi-recent.img, what's in a name).
I started lukechilds/dockerpi:vm pi2 with the command below.

I was then able to update the container/img file with pacman.
I can ssh into other devices on my lan.

But when I try to ping 8.8.8.8, there is no output.
I checked journalctl -f, and there is also no information specific to the ping command.

I had understood that the network adapter should be named usb0, but it is named eth0.

[...]# ip a show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 40:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0
       valid_lft 85146sec preferred_lft 85146sec
    inet6 fec0::4254:ff:fe12:3457/64 scope site dynamic mngtmpaddr noprefixroute
       valid_lft 86347sec preferred_lft 14347sec
    inet6 fe80::4254:ff:fe12:3457/64 scope link
       valid_lft forever preferred_lft forever

I captured the startup log below, but cut out a few lines. Please let me know if should provide more of the startup logs?

[...]$ docker run -it -p5022:5022 -v `pwd`/custom-pi-recent.img:/sdcard/filesystem.img lukechilds/dockerpi:vm pi2
image: /sdcard/filesystem.img
file format: raw
virtual size: 2 GiB (2147483648 bytes)
disk size: 1.85 GiB
Extracting partitions
dd: invalid number 'heads,'
192512+0 records in
192512+0 records out
98566144 bytes (94.0MB) copied, 0.842927 seconds, 111.5MB/s
Extracting boot filesystem
...
Extracting /localhost to /fat/localhost
Searching for kernel='kernel7.img'
Searching for dtb='bcm2709-rpi-2-b.dtb'
Booting QEMU machine "raspi2b" with kernel=/fat/kernel7.img dtb=/fat/bcm2709-rpi-2-b.dtb
[    0.000000] Booting Linux on physical CPU 0xf00
[    0.000000] Linux version 5.10.39-2-ARCH (builduser@leming) (armv7l-unknown-linux-gnueabihf-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP Thu May 27 14:26:43 UTC 2021
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi 2 Model B
...
[    5.936896] usb 1-1: New USB device found, idVendor=0409, idProduct=55aa, bcdDevice= 1.01
[    5.937623] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    5.938151] usb 1-1: Product: QEMU USB Hub
[    5.938570] usb 1-1: Manufacturer: QEMU
[    5.938874] usb 1-1: SerialNumber: 314159-1
[    5.942714] hub 1-1:1.0: USB hub found
[    5.943738] hub 1-1:1.0: 8 ports detected
[    6.319205] usb 1-1.1: new full-speed USB device number 3 using dwc_otg
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
[    6.478431] random: fast init done
[    6.491835] usb 1-1.1: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 0.00
[    6.494305] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=10
[    6.494700] usb 1-1.1: Product: RNDIS/QEMU USB Network Device
[    6.495067] usb 1-1.1: Manufacturer: QEMU
[    6.495203] usb 1-1.1: SerialNumber: 1-1.1
usbnet: failed control transaction: request 0x2143 value 0xc index 0x0 length 0x0
[    6.554494] cdc_ether 1-1.1:1.0 eth0: register 'cdc_ether' at usb-3f980000.usb-1.1, CDC Ethernet Device, 40:54:00:12:34:57
[    8.974408] systemd[1]: System time before build time, advancing clock.
[    9.515219] NET: Registered protocol family 10
[    9.959964] Segment Routing with IPv6
[   11.180298] systemd[1]: systemd 248.3-2-arch running in system mode. (+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified)
[   11.204234] systemd[1]: Detected architecture arm.

Welcome to Arch Linux ARM!
...
         Starting User Login Management...
usbnet: failed control transaction: request 0x2143 value 0xe index 0x0 length 0x0
usbnet: failed control transaction: request 0x2143 value 0xe index 0x0 length 0x0
...
Arch Linux 5.10.39-2-ARCH (ttyAMA0)

Network connectivity

Even though the qemu command line contains the --net directive and the host (in this case the Docker Container) has connectivity (confirmed by using docker exec -it <container-id> ping 1.1.1.1) while the raspberry does not. DHCP inside the pi works and it can seemingly reach the QEMU host OS at 10.0.2.2 as per QEMU default DHCPD settings but nothing beyond that like 1.1.1.1, probably some forwarding/routing necessary?

Not Booting after `apt-get upgrade`

Using the current commit, the Qemu VM of a PI3 is not booting after having done a sudo apt-get upgrade
Presume there is something in the upgrade that breaks the VM but do not know where to start finding a fix

this is a snippet of the vm startup

........
Extracting /fixup4x.dat to /fat/fixup4x.dat
Extracting /LICENCE.broadcom to /fat/LICENCE.broadcom
Searching for kernel='kernel8.img'
Searching for dtb='bcm2710-rpi-3-b-plus.dtb'
Booting QEMU machine "raspi3b" with kernel=/fat/kernel8.img dtb=/fat/bcm2710-rpi-3-b-plus.dtb
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1

the Slirp: Failed ... messages repeat with long intervals between 5+min and the docker VM is using 50% plus of CPU resources of HOST

The following while not the same as an upgrade prove to me that updates are persistant across reboots.

sudo apt-get update requires the argument --allow-releaseinfo-change
sudo apt-get install git

Host is DockerDesktop , windows 10

Basic VNC Server

Hi,

Has anyone tried hooking up a display to this vm via a VNC server? I'm building a custom install for a kiosk-type application and wanted to be able to emulate a display and access it via VNC so that once the application is developed I can deploy the disk image directly to a pi.

So far I've gotten lightDM and vnc installed but I'm having trouble getting lightDM and vnc up and running. Has anyone done this?

I'll post more details as I get farther along.

Mechanism to assign user/password on first boot?

Hello!

So for security reasons, Raspberry Pi OS images no longer come with a pre-configured pi user - see here:

https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/

The good news is, you can still do headless configurations on a physical Pi by placing a userconf file in the /boot partition.

Is there a mechanism to do this in dockerpi?

(I realise that the repo hasn't been updated for a while - I hope it's still maintained, it seems like a really useful tool!)

Help: Access via FTP (and some other questions)

Hi guys,

First of all, I'm pretty newbie/clumsy with QEMU/Docker.

I've developped a NodeJS app, and I want to package it with pkg. The thing is I want to run it on my Raspberry 4, with armv7l. So I have to package it using the same architecture than a RPi to make it work.

1 - I tried to use dockerpi to do this job. For now, am I right?

2 - So, I successfully run dockerpi (pretty easy with docker run -it -p 5022:5022 lukechilds/dockerpi pi2), but I cannot access to the RPi via FTP, or even connect to SSH from my terminal:

ssh [email protected] -p 5022
ssh: connect to host 172.17.0.2 port 5022: Operation timed out

Maybe I miss something?

3 - Also, when I watch my container with Docker Desktop, the CPU usage is always > 120%. Is it normal?

4 - The purpose is to build faster than a real RPi (it takes several hours). How can I improve the number of CPUs/RAM?

I know this is not the place to ask that, but if you have any other idea to build my NodeJS app onto armv7l architecture, feel free to help me :)

Thank you!

Unable to run pi3 emulation "qemu-system-aarch64: Slirp: Failed to send packet, ret: -1"

I tried running raspios buster with pi3 emulation mode but the container just consumed lots of CPU and output "qemu-system-aarch64: Slirp: Failed to send packet, ret: -1" once in a while. I waited for half an hour, thinking that emulation must be slow but still no other output.

This is my command:

$ docker run -it -v /2021-03-04-raspios-buster-armhf.img:/sdcard/filesystem.img lukechilds/dockerpi:vm pi3
Docker output
image: /sdcard/filesystem.img
file format: raw
virtual size: 4 GiB (4294967296 bytes)
disk size: 3.7 GiB
Extracting partitions
524288+0 records in
524288+0 records out
268435456 bytes (256.0MB) copied, 0.937080 seconds, 273.2MB/s
Extracting boot filesystem
Extracting /overlays/adau7002-simple.dtbo to /fat/overlays/adau7002-simple.dtbo
Extracting /overlays/README to /fat/overlays/README
Extracting /overlays/act-led.dtbo to /fat/overlays/act-led.dtbo
Extracting /overlays/adafruit18.dtbo to /fat/overlays/adafruit18.dtbo
Extracting /overlays/adau1977-adc.dtbo to /fat/overlays/adau1977-adc.dtbo
Extracting /overlays/akkordion-iqdacplus.dtbo to /fat/overlays/akkordion-iqdacplus.dtbo
Extracting /overlays/ads1015.dtbo to /fat/overlays/ads1015.dtbo
Extracting /overlays/ads1115.dtbo to /fat/overlays/ads1115.dtbo
Extracting /overlays/ads7846.dtbo to /fat/overlays/ads7846.dtbo
Extracting /overlays/adv7282m.dtbo to /fat/overlays/adv7282m.dtbo
Extracting /overlays/adv728x-m.dtbo to /fat/overlays/adv728x-m.dtbo
Extracting /overlays/audioinjector-addons.dtbo to /fat/overlays/audioinjector-addons.dtbo
Extracting /overlays/anyspi.dtbo to /fat/overlays/anyspi.dtbo
Extracting /overlays/allo-boss-dac-pcm512x-audio.dtbo to /fat/overlays/allo-boss-dac-pcm512x-audio.dtbo
Extracting /overlays/allo-boss2-dac-audio.dtbo to /fat/overlays/allo-boss2-dac-audio.dtbo
Extracting /overlays/allo-digione.dtbo to /fat/overlays/allo-digione.dtbo
Extracting /overlays/allo-katana-dac-audio.dtbo to /fat/overlays/allo-katana-dac-audio.dtbo
Extracting /overlays/allo-piano-dac-pcm512x-audio.dtbo to /fat/overlays/allo-piano-dac-pcm512x-audio.dtbo
Extracting /overlays/allo-piano-dac-plus-pcm512x-audio.dtbo to /fat/overlays/allo-piano-dac-plus-pcm512x-audio.dtbo
Extracting /overlays/apds9960.dtbo to /fat/overlays/apds9960.dtbo
Extracting /overlays/applepi-dac.dtbo to /fat/overlays/applepi-dac.dtbo
Extracting /overlays/at86rf233.dtbo to /fat/overlays/at86rf233.dtbo
Extracting /overlays/dionaudio-loco-v2.dtbo to /fat/overlays/dionaudio-loco-v2.dtbo
Extracting /overlays/audremap.dtbo to /fat/overlays/audremap.dtbo
Extracting /overlays/audioinjector-isolated-soundcard.dtbo to /fat/overlays/audioinjector-isolated-soundcard.dtbo
Extracting /overlays/audioinjector-ultra.dtbo to /fat/overlays/audioinjector-ultra.dtbo
Extracting /overlays/audioinjector-wm8731-audio.dtbo to /fat/overlays/audioinjector-wm8731-audio.dtbo
Extracting /overlays/audiosense-pi.dtbo to /fat/overlays/audiosense-pi.dtbo
Extracting /overlays/balena-fin.dtbo to /fat/overlays/balena-fin.dtbo
Extracting /overlays/cma.dtbo to /fat/overlays/cma.dtbo
Extracting /overlays/dht11.dtbo to /fat/overlays/dht11.dtbo
Extracting /overlays/dionaudio-loco.dtbo to /fat/overlays/dionaudio-loco.dtbo
Extracting /overlays/disable-bt.dtbo to /fat/overlays/disable-bt.dtbo
Extracting /overlays/disable-wifi.dtbo to /fat/overlays/disable-wifi.dtbo
Extracting /overlays/dpi18.dtbo to /fat/overlays/dpi18.dtbo
Extracting /overlays/dpi24.dtbo to /fat/overlays/dpi24.dtbo
Extracting /overlays/draws.dtbo to /fat/overlays/draws.dtbo
Extracting /overlays/dwc-otg.dtbo to /fat/overlays/dwc-otg.dtbo
Extracting /overlays/dwc2.dtbo to /fat/overlays/dwc2.dtbo
Extracting /overlays/edt-ft5406.dtbo to /fat/overlays/edt-ft5406.dtbo
Extracting /overlays/enc28j60-spi2.dtbo to /fat/overlays/enc28j60-spi2.dtbo
Extracting /overlays/enc28j60.dtbo to /fat/overlays/enc28j60.dtbo
Extracting /overlays/exc3000.dtbo to /fat/overlays/exc3000.dtbo
Extracting /overlays/fe-pi-audio.dtbo to /fat/overlays/fe-pi-audio.dtbo
Extracting /overlays/fsm-demo.dtbo to /fat/overlays/fsm-demo.dtbo
Extracting /overlays/ghost-amp.dtbo to /fat/overlays/ghost-amp.dtbo
Extracting /overlays/goodix.dtbo to /fat/overlays/goodix.dtbo
Extracting /overlays/googlevoicehat-soundcard.dtbo to /fat/overlays/googlevoicehat-soundcard.dtbo
Extracting /overlays/gpio-fan.dtbo to /fat/overlays/gpio-fan.dtbo
Extracting /overlays/gpio-ir-tx.dtbo to /fat/overlays/gpio-ir-tx.dtbo
Extracting /overlays/gpio-ir.dtbo to /fat/overlays/gpio-ir.dtbo
Extracting /overlays/gpio-key.dtbo to /fat/overlays/gpio-key.dtbo
Extracting /overlays/gpio-no-bank0-irq.dtbo to /fat/overlays/gpio-no-bank0-irq.dtbo
Extracting /overlays/gpio-no-irq.dtbo to /fat/overlays/gpio-no-irq.dtbo
Extracting /overlays/gpio-poweroff.dtbo to /fat/overlays/gpio-poweroff.dtbo
Extracting /overlays/gpio-shutdown.dtbo to /fat/overlays/gpio-shutdown.dtbo
Extracting /overlays/hd44780-lcd.dtbo to /fat/overlays/hd44780-lcd.dtbo
Extracting /overlays/hdmi-backlight-hwhack-gpio.dtbo to /fat/overlays/hdmi-backlight-hwhack-gpio.dtbo
Extracting /overlays/hifiberry-amp.dtbo to /fat/overlays/hifiberry-amp.dtbo
Extracting /overlays/hifiberry-amp100.dtbo to /fat/overlays/hifiberry-amp100.dtbo
Extracting /overlays/hifiberry-dac.dtbo to /fat/overlays/hifiberry-dac.dtbo
Extracting /overlays/hifiberry-dacplus.dtbo to /fat/overlays/hifiberry-dacplus.dtbo
Extracting /overlays/hifiberry-dacplusadc.dtbo to /fat/overlays/hifiberry-dacplusadc.dtbo
Extracting /overlays/hifiberry-dacplusadcpro.dtbo to /fat/overlays/hifiberry-dacplusadcpro.dtbo
Extracting /overlays/hifiberry-dacplusdsp.dtbo to /fat/overlays/hifiberry-dacplusdsp.dtbo
Extracting /overlays/hifiberry-dacplushd.dtbo to /fat/overlays/hifiberry-dacplushd.dtbo
Extracting /overlays/hifiberry-digi-pro.dtbo to /fat/overlays/hifiberry-digi-pro.dtbo
Extracting /overlays/hifiberry-digi.dtbo to /fat/overlays/hifiberry-digi.dtbo
Extracting /overlays/highperi.dtbo to /fat/overlays/highperi.dtbo
Extracting /overlays/hy28a.dtbo to /fat/overlays/hy28a.dtbo
Extracting /overlays/hy28b-2017.dtbo to /fat/overlays/hy28b-2017.dtbo
Extracting /overlays/hy28b.dtbo to /fat/overlays/hy28b.dtbo
Extracting /overlays/i-sabre-q2m.dtbo to /fat/overlays/i-sabre-q2m.dtbo
Extracting /overlays/i2c-bcm2708.dtbo to /fat/overlays/i2c-bcm2708.dtbo
Extracting /overlays/i2c-gpio.dtbo to /fat/overlays/i2c-gpio.dtbo
Extracting /overlays/i2c-mux.dtbo to /fat/overlays/i2c-mux.dtbo
Extracting /overlays/i2c-pwm-pca9685a.dtbo to /fat/overlays/i2c-pwm-pca9685a.dtbo
Extracting /overlays/i2c-rtc-gpio.dtbo to /fat/overlays/i2c-rtc-gpio.dtbo
Extracting /overlays/i2c-rtc.dtbo to /fat/overlays/i2c-rtc.dtbo
Extracting /overlays/i2c-sensor.dtbo to /fat/overlays/i2c-sensor.dtbo
Extracting /overlays/i2c0.dtbo to /fat/overlays/i2c0.dtbo
Extracting /overlays/i2c1.dtbo to /fat/overlays/i2c1.dtbo
Extracting /overlays/i2c3.dtbo to /fat/overlays/i2c3.dtbo
Extracting /overlays/i2c4.dtbo to /fat/overlays/i2c4.dtbo
Extracting /overlays/i2c5.dtbo to /fat/overlays/i2c5.dtbo
Extracting /overlays/i2c6.dtbo to /fat/overlays/i2c6.dtbo
Extracting /overlays/i2s-gpio28-31.dtbo to /fat/overlays/i2s-gpio28-31.dtbo
Extracting /overlays/ilitek251x.dtbo to /fat/overlays/ilitek251x.dtbo
Extracting /overlays/imx219.dtbo to /fat/overlays/imx219.dtbo
Extracting /overlays/imx290.dtbo to /fat/overlays/imx290.dtbo
Extracting /overlays/imx477.dtbo to /fat/overlays/imx477.dtbo
Extracting /overlays/iqaudio-codec.dtbo to /fat/overlays/iqaudio-codec.dtbo
Extracting /overlays/iqaudio-dac.dtbo to /fat/overlays/iqaudio-dac.dtbo
Extracting /overlays/iqaudio-dacplus.dtbo to /fat/overlays/iqaudio-dacplus.dtbo
Extracting /overlays/iqaudio-digi-wm8804-audio.dtbo to /fat/overlays/iqaudio-digi-wm8804-audio.dtbo
Extracting /overlays/irs1125.dtbo to /fat/overlays/irs1125.dtbo
Extracting /overlays/jedec-spi-nor.dtbo to /fat/overlays/jedec-spi-nor.dtbo
Extracting /overlays/justboom-both.dtbo to /fat/overlays/justboom-both.dtbo
Extracting /overlays/justboom-dac.dtbo to /fat/overlays/justboom-dac.dtbo
Extracting /overlays/justboom-digi.dtbo to /fat/overlays/justboom-digi.dtbo
Extracting /overlays/ltc294x.dtbo to /fat/overlays/ltc294x.dtbo
Extracting /overlays/max98357a.dtbo to /fat/overlays/max98357a.dtbo
Extracting /overlays/maxtherm.dtbo to /fat/overlays/maxtherm.dtbo
Extracting /overlays/mbed-dac.dtbo to /fat/overlays/mbed-dac.dtbo
Extracting /overlays/mcp23017.dtbo to /fat/overlays/mcp23017.dtbo
Extracting /overlays/mcp23s17.dtbo to /fat/overlays/mcp23s17.dtbo
Extracting /overlays/mcp2515-can0.dtbo to /fat/overlays/mcp2515-can0.dtbo
Extracting /overlays/mcp2515-can1.dtbo to /fat/overlays/mcp2515-can1.dtbo
Extracting /overlays/mcp251xfd.dtbo to /fat/overlays/mcp251xfd.dtbo
Extracting /overlays/mcp3008.dtbo to /fat/overlays/mcp3008.dtbo
Extracting /overlays/mcp3202.dtbo to /fat/overlays/mcp3202.dtbo
Extracting /overlays/mcp342x.dtbo to /fat/overlays/mcp342x.dtbo
Extracting /overlays/media-center.dtbo to /fat/overlays/media-center.dtbo
Extracting /overlays/merus-amp.dtbo to /fat/overlays/merus-amp.dtbo
Extracting /overlays/midi-uart0.dtbo to /fat/overlays/midi-uart0.dtbo
Extracting /overlays/midi-uart1.dtbo to /fat/overlays/midi-uart1.dtbo
Extracting /overlays/miniuart-bt.dtbo to /fat/overlays/miniuart-bt.dtbo
Extracting /overlays/mmc.dtbo to /fat/overlays/mmc.dtbo
Extracting /overlays/mpu6050.dtbo to /fat/overlays/mpu6050.dtbo
Extracting /overlays/mz61581.dtbo to /fat/overlays/mz61581.dtbo
Extracting /overlays/ov5647.dtbo to /fat/overlays/ov5647.dtbo
Extracting /overlays/ov7251.dtbo to /fat/overlays/ov7251.dtbo
Extracting /overlays/ov9281.dtbo to /fat/overlays/ov9281.dtbo
Extracting /overlays/overlay_map.dtb to /fat/overlays/overlay_map.dtb
Extracting /overlays/papirus.dtbo to /fat/overlays/papirus.dtbo
Extracting /overlays/pca953x.dtbo to /fat/overlays/pca953x.dtbo
Extracting /overlays/pibell.dtbo to /fat/overlays/pibell.dtbo
Extracting /overlays/pifacedigital.dtbo to /fat/overlays/pifacedigital.dtbo
Extracting /overlays/pifi-40.dtbo to /fat/overlays/pifi-40.dtbo
Extracting /overlays/pifi-dac-hd.dtbo to /fat/overlays/pifi-dac-hd.dtbo
Extracting /overlays/pifi-dac-zero.dtbo to /fat/overlays/pifi-dac-zero.dtbo
Extracting /overlays/pifi-mini-210.dtbo to /fat/overlays/pifi-mini-210.dtbo
Extracting /overlays/piglow.dtbo to /fat/overlays/piglow.dtbo
Extracting /overlays/piscreen.dtbo to /fat/overlays/piscreen.dtbo
Extracting /overlays/piscreen2r.dtbo to /fat/overlays/piscreen2r.dtbo
Extracting /overlays/pisound.dtbo to /fat/overlays/pisound.dtbo
Extracting /overlays/pitft22.dtbo to /fat/overlays/pitft22.dtbo
Extracting /overlays/pitft28-capacitive.dtbo to /fat/overlays/pitft28-capacitive.dtbo
Extracting /overlays/pitft28-resistive.dtbo to /fat/overlays/pitft28-resistive.dtbo
Extracting /overlays/pitft35-resistive.dtbo to /fat/overlays/pitft35-resistive.dtbo
Extracting /overlays/pps-gpio.dtbo to /fat/overlays/pps-gpio.dtbo
Extracting /overlays/pwm-2chan.dtbo to /fat/overlays/pwm-2chan.dtbo
Extracting /overlays/pwm-ir-tx.dtbo to /fat/overlays/pwm-ir-tx.dtbo
Extracting /overlays/pwm.dtbo to /fat/overlays/pwm.dtbo
Extracting /overlays/qca7000.dtbo to /fat/overlays/qca7000.dtbo
Extracting /overlays/rotary-encoder.dtbo to /fat/overlays/rotary-encoder.dtbo
Extracting /overlays/rpi-backlight.dtbo to /fat/overlays/rpi-backlight.dtbo
Extracting /overlays/rpi-cirrus-wm5102.dtbo to /fat/overlays/rpi-cirrus-wm5102.dtbo
Extracting /overlays/rpi-dac.dtbo to /fat/overlays/rpi-dac.dtbo
Extracting /overlays/rpi-display.dtbo to /fat/overlays/rpi-display.dtbo
Extracting /overlays/rpi-ft5406.dtbo to /fat/overlays/rpi-ft5406.dtbo
Extracting /overlays/rpi-poe.dtbo to /fat/overlays/rpi-poe.dtbo
Extracting /overlays/rpi-proto.dtbo to /fat/overlays/rpi-proto.dtbo
Extracting /overlays/rpi-sense.dtbo to /fat/overlays/rpi-sense.dtbo
Extracting /overlays/rpi-tv.dtbo to /fat/overlays/rpi-tv.dtbo
Extracting /overlays/rpivid-v4l2.dtbo to /fat/overlays/rpivid-v4l2.dtbo
Extracting /overlays/rra-digidac1-wm8741-audio.dtbo to /fat/overlays/rra-digidac1-wm8741-audio.dtbo
Extracting /overlays/sainsmart18.dtbo to /fat/overlays/sainsmart18.dtbo
Extracting /overlays/sc16is750-i2c.dtbo to /fat/overlays/sc16is750-i2c.dtbo
Extracting /overlays/sc16is752-i2c.dtbo to /fat/overlays/sc16is752-i2c.dtbo
Extracting /overlays/sc16is752-spi0.dtbo to /fat/overlays/sc16is752-spi0.dtbo
Extracting /overlays/sc16is752-spi1.dtbo to /fat/overlays/sc16is752-spi1.dtbo
Extracting /overlays/sdhost.dtbo to /fat/overlays/sdhost.dtbo
Extracting /overlays/sdio.dtbo to /fat/overlays/sdio.dtbo
Extracting /overlays/seeed-can-fd-hat-v1.dtbo to /fat/overlays/seeed-can-fd-hat-v1.dtbo
Extracting /overlays/seeed-can-fd-hat-v2.dtbo to /fat/overlays/seeed-can-fd-hat-v2.dtbo
Extracting /overlays/sh1106-spi.dtbo to /fat/overlays/sh1106-spi.dtbo
Extracting /overlays/smi-dev.dtbo to /fat/overlays/smi-dev.dtbo
Extracting /overlays/smi-nand.dtbo to /fat/overlays/smi-nand.dtbo
Extracting /overlays/smi.dtbo to /fat/overlays/smi.dtbo
Extracting /overlays/spi-gpio35-39.dtbo to /fat/overlays/spi-gpio35-39.dtbo
Extracting /overlays/spi-gpio40-45.dtbo to /fat/overlays/spi-gpio40-45.dtbo
Extracting /overlays/spi-rtc.dtbo to /fat/overlays/spi-rtc.dtbo
Extracting /overlays/spi0-1cs.dtbo to /fat/overlays/spi0-1cs.dtbo
Extracting /overlays/spi0-2cs.dtbo to /fat/overlays/spi0-2cs.dtbo
Extracting /overlays/spi1-1cs.dtbo to /fat/overlays/spi1-1cs.dtbo
Extracting /overlays/spi1-2cs.dtbo to /fat/overlays/spi1-2cs.dtbo
Extracting /overlays/spi1-3cs.dtbo to /fat/overlays/spi1-3cs.dtbo
Extracting /overlays/spi2-1cs.dtbo to /fat/overlays/spi2-1cs.dtbo
Extracting /overlays/spi2-2cs.dtbo to /fat/overlays/spi2-2cs.dtbo
Extracting /overlays/spi2-3cs.dtbo to /fat/overlays/spi2-3cs.dtbo
Extracting /overlays/spi3-1cs.dtbo to /fat/overlays/spi3-1cs.dtbo
Extracting /overlays/spi3-2cs.dtbo to /fat/overlays/spi3-2cs.dtbo
Extracting /overlays/spi4-1cs.dtbo to /fat/overlays/spi4-1cs.dtbo
Extracting /overlays/spi4-2cs.dtbo to /fat/overlays/spi4-2cs.dtbo
Extracting /overlays/spi5-1cs.dtbo to /fat/overlays/spi5-1cs.dtbo
Extracting /overlays/spi5-2cs.dtbo to /fat/overlays/spi5-2cs.dtbo
Extracting /overlays/spi6-1cs.dtbo to /fat/overlays/spi6-1cs.dtbo
Extracting /overlays/spi6-2cs.dtbo to /fat/overlays/spi6-2cs.dtbo
Extracting /overlays/ssd1306-spi.dtbo to /fat/overlays/ssd1306-spi.dtbo
Extracting /overlays/ssd1306.dtbo to /fat/overlays/ssd1306.dtbo
Extracting /overlays/ssd1351-spi.dtbo to /fat/overlays/ssd1351-spi.dtbo
Extracting /overlays/superaudioboard.dtbo to /fat/overlays/superaudioboard.dtbo
Extracting /overlays/sx150x.dtbo to /fat/overlays/sx150x.dtbo
Extracting /overlays/tc358743-audio.dtbo to /fat/overlays/tc358743-audio.dtbo
Extracting /overlays/tc358743.dtbo to /fat/overlays/tc358743.dtbo
Extracting /overlays/tinylcd35.dtbo to /fat/overlays/tinylcd35.dtbo
Extracting /overlays/tpm-slb9670.dtbo to /fat/overlays/tpm-slb9670.dtbo
Extracting /overlays/uart0.dtbo to /fat/overlays/uart0.dtbo
Extracting /overlays/uart1.dtbo to /fat/overlays/uart1.dtbo
Extracting /overlays/uart2.dtbo to /fat/overlays/uart2.dtbo
Extracting /overlays/uart3.dtbo to /fat/overlays/uart3.dtbo
Extracting /overlays/uart4.dtbo to /fat/overlays/uart4.dtbo
Extracting /overlays/uart5.dtbo to /fat/overlays/uart5.dtbo
Extracting /overlays/udrc.dtbo to /fat/overlays/udrc.dtbo
Extracting /overlays/upstream-pi4.dtbo to /fat/overlays/upstream-pi4.dtbo
Extracting /overlays/upstream.dtbo to /fat/overlays/upstream.dtbo
Extracting /overlays/vc4-fkms-v3d.dtbo to /fat/overlays/vc4-fkms-v3d.dtbo
Extracting /overlays/vc4-kms-dsi-7inch.dtbo to /fat/overlays/vc4-kms-dsi-7inch.dtbo
Extracting /overlays/vc4-kms-kippah-7inch.dtbo to /fat/overlays/vc4-kms-kippah-7inch.dtbo
Extracting /overlays/vc4-kms-v3d-pi4.dtbo to /fat/overlays/vc4-kms-v3d-pi4.dtbo
Extracting /overlays/vc4-kms-v3d.dtbo to /fat/overlays/vc4-kms-v3d.dtbo
Extracting /overlays/vc4-kms-vga666.dtbo to /fat/overlays/vc4-kms-vga666.dtbo
Extracting /overlays/vga666.dtbo to /fat/overlays/vga666.dtbo
Extracting /overlays/w1-gpio-pullup.dtbo to /fat/overlays/w1-gpio-pullup.dtbo
Extracting /overlays/w1-gpio.dtbo to /fat/overlays/w1-gpio.dtbo
Extracting /overlays/w5500.dtbo to /fat/overlays/w5500.dtbo
Extracting /overlays/wittypi.dtbo to /fat/overlays/wittypi.dtbo
Extracting /overlays/wm8960-soundcard.dtbo to /fat/overlays/wm8960-soundcard.dtbo
Extracting /bcm2708-rpi-b-plus.dtb to /fat/bcm2708-rpi-b-plus.dtb
Extracting /COPYING.linux to /fat/COPYING.linux
Extracting /LICENCE.broadcom to /fat/LICENCE.broadcom
Extracting /issue.txt to /fat/issue.txt
Extracting /bcm2708-rpi-b-rev1.dtb to /fat/bcm2708-rpi-b-rev1.dtb
Extracting /bcm2708-rpi-b.dtb to /fat/bcm2708-rpi-b.dtb
Extracting /bcm2708-rpi-cm.dtb to /fat/bcm2708-rpi-cm.dtb
Extracting /bcm2708-rpi-zero-w.dtb to /fat/bcm2708-rpi-zero-w.dtb
Extracting /bcm2708-rpi-zero.dtb to /fat/bcm2708-rpi-zero.dtb
Extracting /bcm2709-rpi-2-b.dtb to /fat/bcm2709-rpi-2-b.dtb
Extracting /bcm2710-rpi-2-b.dtb to /fat/bcm2710-rpi-2-b.dtb
Extracting /bcm2710-rpi-3-b-plus.dtb to /fat/bcm2710-rpi-3-b-plus.dtb
Extracting /bcm2710-rpi-3-b.dtb to /fat/bcm2710-rpi-3-b.dtb
Extracting /bcm2710-rpi-cm3.dtb to /fat/bcm2710-rpi-cm3.dtb
Extracting /bcm2711-rpi-4-b.dtb to /fat/bcm2711-rpi-4-b.dtb
Extracting /bcm2711-rpi-400.dtb to /fat/bcm2711-rpi-400.dtb
Extracting /bcm2711-rpi-cm4.dtb to /fat/bcm2711-rpi-cm4.dtb
Extracting /bootcode.bin to /fat/bootcode.bin
Extracting /cmdline.txt to /fat/cmdline.txt
Extracting /config.txt to /fat/config.txt
Extracting /fixup.dat to /fat/fixup.dat
Extracting /fixup4.dat to /fat/fixup4.dat
Extracting /fixup4cd.dat to /fat/fixup4cd.dat
Extracting /fixup4db.dat to /fat/fixup4db.dat
Extracting /fixup4x.dat to /fat/fixup4x.dat
Extracting /fixup_cd.dat to /fat/fixup_cd.dat
Extracting /fixup_db.dat to /fat/fixup_db.dat
Extracting /fixup_x.dat to /fat/fixup_x.dat
Extracting /kernel.img to /fat/kernel.img
Extracting /kernel7.img to /fat/kernel7.img
Extracting /kernel7l.img to /fat/kernel7l.img
Extracting /kernel8.img to /fat/kernel8.img
Extracting /start.elf to /fat/start.elf
Extracting /start4.elf to /fat/start4.elf
Extracting /start4cd.elf to /fat/start4cd.elf
Extracting /start4db.elf to /fat/start4db.elf
Extracting /start4x.elf to /fat/start4x.elf
Extracting /start_cd.elf to /fat/start_cd.elf
Extracting /start_db.elf to /fat/start_db.elf
Extracting /start_x.elf to /fat/start_x.elf
Searching for kernel='kernel8.img'
Searching for dtb='bcm2710-rpi-3-b-plus.dtb'
Booting QEMU machine "raspi3b" with kernel=/fat/kernel8.img dtb=/fat/bcm2710-rpi-3-b-plus.dtb
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1

Pi4 support

I'm using this to create images for a Raspberry Pi 4, and while running with pi1 seems to work okay, proper support would be nice to have. Using pi3 results in a missing network connection, so I can't really install packages.

Struggling understanding how to make it all work

I am very sorry but I am just unable to get this working for me correctly in a windows environment.

I am trying to do two things:

  1. Maintain a static file system between boots.
    a. I use the command docker run -it -v $HOME/.dockerpi:/sdcard lukechilds/dockerpi
    b. to run this without an error I need to remove the ":" from the directory spec.
    c. Once the system boots I have created a test file in the pi home directory. I then shut it all down and run the above command again. It does not have my test file in it. I must be missing something very simple.

  2. I have a custom image that I want to load. I cannot get the syntax properly. Let's say that my image is called test1.img and it is located in the C:/ directory. What would be my syntax for loading that image?

Again, my apologies. I am just not being very successful in my attempts.

A regular file was expected by the 'file' driver, but something else was given

Hi, I have the image lukechilds/dockerpi:vm
And the image 2020-08-20-raspios-buster-armhf-lite.img

I'm running the command like this:
docker run -it -v 2020-08-20-raspios-buster-armhf-lite.img:/sdcard/filesystem.img lukechilds/dockerpi:vm

But I get this error

C:\Users\usr\Downloads\2020-08-20-raspios-buster-armhf-lite>docker run -it -v 2020-08-20-raspios-buster-armhf-lite.img:/sdcard/filesystem.img lukechilds/dockerpi:vm

Booting QEMU machine "versatilepb" with kernel=/root/qemu-rpi-kernel/kernel-qemu-4.19.50-buster dtb=/root/qemu-rpi-kernel/versatile-pb.dtb
qemu-system-arm: --drive format=raw,file=/sdcard/filesystem.img: A regular file was expected by the 'file' driver, but something else was given

Is my raspbian image so new that is not supported?

Thanks

Cannot open access to console, the root account is locked while running this docker on the jetson nano (arm64)

Hello.

I tried to install your dockerpi on my jetson nano,but this is what happened :

[ TIME ] Timed out waiting for device /disk/by-partuuid/6c586e13-01.
[DEPEND] Dependency failed for /boot.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for File?/disk/by-partuuid/6c586e13-01.
         Starting Preprocess NFS configuration...
         Starting Set console font and keymap...
         Starting Raise network interfaces...
[  OK  ] Stopped Dispatch Password ?ts to Console Directory Watch.
[  OK  ] Stopped Forward Password R?uests to Wall Directory Watch.
[  OK  ] Reached target Timers.
[  OK  ] Reached target Login Prompts.
[  OK  ] Closed Syslog Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Started Emergency Shell.
[  OK  ] Reached target Emergency Mode.
         Starting Create Volatile Files and Directories...
[  OK  ] Started Preprocess NFS configuration.
[  OK  ] Started Set console font and keymap.
You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.

Cannot open access to console, the root account is locked.
See sulogin(8) man page for more details.

Press Enter to continue. ---> nothing happens here.

Yocto/Poky support - non-standard kernel file

Hi

Thanks first of all for this container image, it's a very useful tool for the lazy (me ๐Ÿ˜), who can't be bothered with setting up QEMU!

I am a relative newbie in the embedded linux space and am trying to leverage this tool to run some automated tests in our ARM based, Raspberry Pi 3 aimed images. We use the Yocto project to create these images which use a different flavor operating system than the one endorsed by the raspberry pi foundation (raspbian), which is why I think I am running into this issue.

As described in the Readme of this repo, I use the following command line to attempt to run a custom Raspberry Pi 3 image:

docker run -it -v /path/to/rpi/image:/sdcard/filesystem.img lukechilds/dockerpi pi3

When running that command I get the following error:

image: /sdcard/filesystem.img
file format: raw
virtual size: 2 GiB (2147483648 bytes)
disk size: 1.12 GiB
Extracting partitions
dd: invalid number '703,3,32'
Extracting boot filesystem
Error: ! Unable to open the input file: /fat.img for reading
Searching for kernel='kernel8.img'
Searching for dtb='bcm2710-rpi-3-b-plus.dtb'
Missing kernel='' or dtb=''

Which makes sense, since when exploring this image via a flashed sd card, I find the following files (apologies for the Windows output format):

 Directory of I:\

2011-04-05  23:00            52,456 bootcode.bin
2011-04-05  23:00                 0 bootfiles-20210527.stamp
2011-04-05  23:00                93 cmdline.txt
2011-04-05  23:00            36,233 config.txt
2011-04-05  23:00             7,314 fixup.dat
2011-04-05  23:00             5,448 fixup4.dat
2011-04-05  23:00             3,191 fixup4cd.dat
2011-04-05  23:00             8,452 fixup4db.dat
2011-04-05  23:00             8,452 fixup4x.dat
2011-04-05  23:00             3,191 fixup_cd.dat
2011-04-05  23:00            10,298 fixup_db.dat
2011-04-05  23:00            10,300 fixup_x.dat
2011-04-05  23:00         2,953,312 start.elf
2011-04-05  23:00         2,229,120 start4.elf
2011-04-05  23:00           793,340 start4cd.elf
2011-04-05  23:00         3,722,664 start4db.elf
2011-04-05  23:00         2,981,480 start4x.elf
2011-04-05  23:00           793,340 start_cd.elf
2011-04-05  23:00         4,794,632 start_db.elf
2011-04-05  23:00         3,705,000 start_x.elf
2011-04-05  23:00            26,093 bcm2708-rpi-zero-w.dtb
2011-04-05  23:00            25,195 bcm2708-rpi-b.dtb
2011-04-05  23:00            25,458 bcm2708-rpi-b-plus.dtb
2011-04-05  23:00            26,333 bcm2709-rpi-2-b.dtb
2011-04-05  23:00            27,980 bcm2710-rpi-3-b.dtb
2011-04-05  23:00            28,599 bcm2710-rpi-3-b-plus.dtb
2011-04-05  23:00            47,516 bcm2711-rpi-4-b.dtb
2011-04-05  23:00            24,928 bcm2708-rpi-cm.dtb
2011-04-05  23:00            26,289 bcm2710-rpi-cm3.dtb
2011-04-05  23:00    <DIR>          overlays
2011-04-05  23:00           479,540 kernel7.img
2011-04-05  23:00               263 boot.scr
2011-04-05  23:00         6,094,312 uImage
2011-04-05  23:00                44 image-version-info
1601-01-01  01:00            16,384 uboot.env

I believe the file that should be 'found' here is kernel7.img which is instead of kernel8.img. Seems like this search is somewhat hardcoded, which makes me think that:

  1. Not possible in current release - I am aware that pi2 & pi3 support is experimental,
  2. Somehow configurable at container startup via something like an environment variable.

So, is it 1. or 2.? ๐Ÿ˜…

Also, if someone with Yocto experience on this container reads this, could you either:

  1. Supply a list of changes required to my image to be supported by this container, and/or,
  2. Supply reading material (please not the Mega-Manual! ๐Ÿ˜ฉ) that could help me get to that point?

Here I provide a minimal working image (~400MB download, be warned!), that runs a bare bones distribution, without our private code. This image file can be:

  1. Used as the custom image file in the docker command to reproduce this issue
  2. Flashed onto an SD card and tested in a physical Raspberry Pi 3 to ensure it works (I tried it) - just sign is as root (no password).

Thanks for reading this if you got this far, please let me know if I have not explained myself enough (I tend to ramble ๐Ÿ˜…) and/or if you have any issue collecting the image file for testing.

Regards

Autologin and/or boot script support

Should this tool support autologin? I'd like to use this image in an automated build environment and having to log in manually or having to patch the raspbian image to enable autologin is cumbersome.

Of course it's possible, but should it be done? Is this tool supposed to be used like this? I guess this is more of a raspbian issue than an issue of this project. What is your opinion?

Non-moving vm tag

First of all, thanks for making and sharing such a great project!

The vm tag is constantly moved on each commit to master. Would it be possible to publish images with "locked" (maybe versioned?) tags that don't move, in case we'd like to replicate images based on older versions?

Using dockerpi to run other ditros' rpi based ARM images

I'm trying to run dockerpi using this Kali linux ARM image (I'm using the last one Kali Linux RaspberryPi 2 (v1.2), 3 and 4 64-Bit).

When running: docker run -it -v <my image path>:/sdcard/filesystem.img lukechilds/dockerpi:vm

The logs ends with this:

Run /sbin/init as init process
request_module: kmod_concurrent_max (0) close to 0 (max_modprobes: 50), for module binfmt-464c, throttling...
request_module: modprobe binfmt-464c cannot be processed, kmod busy with 50 threads for more than 5 seconds now
Starting init: /sbin/init exists but couldn't execute it (error -8)
Run /etc/init as init process
Run /bin/init as init process
Run /bin/sh as init process
request_module: kmod_concurrent_max (0) close to 0 (max_modprobes: 50), for module binfmt-464c, throttling...
request_module: modprobe binfmt-464c cannot be processed, kmod busy with 50 threads for more than 5 seconds now
Starting init: /bin/sh exists but couldn't execute it (error -8)
Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.50+ #1
Hardware name: ARM-Versatile (Device Tree Support)
[<c001d230>] (unwind_backtrace) from [<c00190ac>] (show_stack+0x10/0x14)
[<c00190ac>] (show_stack) from [<c0025f14>] (panic+0xc8/0x240)
[<c0025f14>] (panic) from [<c054b434>] (kernel_init+0xb8/0xe8)
[<c054b434>] (kernel_init) from [<c00090e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xcf823fb0 to 0xcf823ff8)
3fa0:                                     00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
Rebooting in 1 seconds..

No modules

My modules list is empty:

pi@raspberrypi:~$ lsmod
Module                  Size  Used by

I see this message at the startup:

[FAILED] Failed to start Load Kernel Modules.

Service is failed:

$ sudo systemctl status systemd-modules-load.service
โ— systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static; ven
   Active: failed (Result: exit-code) since Fri 2021-09-10 16:11:29 BST; 2min 15
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
  Process: 56 ExecStart=/lib/systemd/systemd-modules-load (code=exited, status=1
 Main PID: 56 (code=exited, status=1/FAILURE)

It seems that my module system fails to load.
I run Raspbian Buster lite:

docker run -it  -v /2020-02-13-raspbian-buster-lite.img:/sdcard/filesystem.img lukechilds/dockerpi:vm

How to create a new image based on this

Hi!

Running this image works great! Unfortunately I creating my own image based on it was less straightforward than I thought. I'm new to Docker but a Dockerfile like this:

FROM  lukechilds/dockerpi

RUN ls -la

outputs a folder structure that doesn't look like a Raspberry Pi.

drwxr-xr-x    1 root     root          4096 Jan 12 19:21 .
drwxr-xr-x    1 root     root          4096 Jan 12 19:21 ..
-rwxr-xr-x    1 root     root             0 Jan 12 19:21 .dockerenv
drwxr-xr-x    2 root     root         12288 Dec  2 20:12 bin
drwxr-xr-x    5 root     root           340 Jan 12 19:21 dev
-rwxr-xr-x    1 root     root           672 Dec 16 22:54 entrypoint.sh
drwxr-xr-x    1 root     root          4096 Jan 12 19:21 etc
-rw-------    1 root     root     454279954 Sep 26 00:26 filesystem.zip
drwxr-xr-x    2 nobody   nogroup       4096 Dec  2 20:12 home
dr-xr-xr-x  189 root     root             0 Jan 12 19:21 proc
drwx------    1 root     root          4096 Dec 16 22:59 root
drwxr-xr-x    2 root     root          4096 Jan 12 19:20 sdcard
dr-xr-xr-x   13 root     root             0 Jan 12 19:21 sys
drwxrwxrwt    1 root     root          4096 Dec 16 22:59 tmp
drwxr-xr-x    1 root     root          4096 Dec 16 22:59 usr
drwxr-xr-x    4 root     root          4096 Dec  2 20:12 var

This image would really be useful if the Readme could give an example Dockerfile showing how to create images based on it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.