At Sipfront, we run telco tests within Docker containers. They might be hosted in the cloud (such as AWS Fargate) or on big bare metal servers, but some use cases require us to deploy small hardware test agents in end customer environments. In that case, we rely on Odroid C4 boards because of their reasonable CPU and network performance.

The problem with the stock kernel

We don’t build our own images, but rather rely on the stock Ubuntu 22.04 arm64/aarch64 image from the Odroid website. That image contains kernel 4.9.312-6, and trying to run a Docker container results in the following error:

1root@odroid:~# docker run hello-world
2docker: Error response from daemon: failed to create task for container:
3failed to create shim task: OCI runtime create failed: runc create failed:
4unable to start container process: error during container init:
5error setting cgroup config for procHooks process: bpf_prog_query(BPF_CGROUP_DEVICE) failed:
6invalid argument: unknown.

Fixing it by modifying the boot config

To fix the cgroup issue, you have to add a kernel parameter when booting your Odroid. You can do this by adding the line setenv bootargs "${bootargs} systemd.unified_cgroup_hierarchy=0" right after the existing bootargs line. Copy/pasting the folling command will do this for you, keeping a backup file in case something goes wrong:

1cp /media/boot/boot.ini /media/boot/boot.ini.orig
2sed 's/setenv bootargs .*/&\nsetenv bootargs "\${bootargs} systemd.unified_cgroup_hierarchy=0"/' \
3  /media/boot/boot.ini.orig > /media/boot/boot.ini

Reboot your Odroid, and your Docker containers will work.

1root@odroid:~# docker run hello-world
2
3Hello from Docker!
4This message shows that your installation appears to be working correctly.
5
6...
7root@odroid:~#

You can do this change also upfront by mounting the boot image using the loop device on linux prior to flashing the image to your SD< or by mounting the SD and modifying the file before there, if your OS allows that (should be possible on Linux, probably trickier on a Mac - leave a comment if you have experience with that).

comments powered by Disqus