2

I am trying to run Docker on Android, using a Pixel 3a XL rooted, running stock rom but flashed a custom kernel. I need to enable cpu, cpuset, memory, io, and pid controllers in cgroupv2. After enabling them in menuconfig and flashing the kernel, the script used to check shows only pid available under cgroupv2 controllers.

What do I need to do besides enabling these options in the kernel’s menuconfig? Did I maybe not enable all the necessary options? Any help would be greatly appreciated!

With the current state, when I run docker I get a warning for each item, ex “WARN: Unable to find cpu controller”. and error setting cgroup config for procHooks process: bpf_prog_query(BPF_CGROUP_DEVICE)

As I understand it, these options may be mounted with cgroupv1 and this is why they do not show up?

I am using this guide: https://gist.github.com/FreddieOliveira/efe850df7ff3951cb62d74bd770dce27

and these are the options I enabled in my kernel using menuconfig: https://wiki.gentoo.org/wiki/Docker

From the config I flashed in my kernel:
CONFIG_CGROUPS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_CGROUP_CPUACCT=y

I flash the kernel by flashing the Image.lz4-dtb file that is created after building the kernel.

Here is a photo after running the script to check if kernel options are all enabled. Am trying to change these from missing to available/enabled.

enter image description here

1 Answer 1

3

The solution was to run: sudo mount -t tmpfs cgroup_root /sys/fs/cgroup which created directories for each of the cgroup resources and allowed Docker to run.

Useful is section 2.1: https://android.googlesource.com/kernel/common/+/android-trusty-3.10/Documentation/cgroups/cgroups.txt

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .