package/docker-engine: depend on cgroup v2 and kernel >=5.2 without systemd

Without systemd package/docker-engine requires another way to mount
/sys/fs/cgroup, so far provided by BR2_PACKAGE_CGROUPFS_MOUNT for
cgroup v1. Replace this with BR2_PACKAGE_CGROUPFS_V2_MOUNT for cgroup
v2 support. 5.2 is the minimum recommended version for cgroup v2
support according to the Docker documentation: "v4.15 or later (v5.2
or later is recommended)" [1].

Depending on the selected container runtime users may need to adjust
kernel configurations to enable options required by that runtime with
cgroup v2 (e.g. CONFIG_CGROUP_BPF for runc).

Propagate dependencies accordingly: The Docker btrfs filesystem driver
does not need a separate and lower minimum headers version,
package/mender-update-modules needs to apply the new "depends on".

[1] https://docs.docker.com/engine/containers/runmetrics/#running-docker-on-cgroup-v2

Signed-off-by: Fiona Klute (WIWA) <fiona.klute@gmx.de>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
This commit is contained in:
Fiona Klute (WIWA)
2025-08-29 13:31:19 +02:00
committed by Romain Naour
parent efe00fb3fb
commit b07b0bb456
2 changed files with 9 additions and 11 deletions

View File

@@ -3,11 +3,12 @@ config BR2_PACKAGE_DOCKER_ENGINE
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_2
depends on !BR2_TOOLCHAIN_USES_UCLIBC # containerd -> runc
depends on BR2_USE_MMU # containerd
depends on !BR2_PACKAGE_CGROUPFS_MOUNT
depends on BR2_PACKAGE_LIBSECCOMP_ARCH_SUPPORTS # libseccomp
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # libseccomp
select BR2_PACKAGE_CGROUPFS_MOUNT if !BR2_PACKAGE_SYSTEMD # runtime dependency
select BR2_PACKAGE_CGROUPFS_V2_MOUNT if !BR2_PACKAGE_SYSTEMD # runtime dependency
select BR2_PACKAGE_CONTAINERD # runtime dependency
select BR2_PACKAGE_HOST_GO
select BR2_PACKAGE_IPTABLES # runtime dependency
@@ -22,13 +23,9 @@ if BR2_PACKAGE_DOCKER_ENGINE
config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS
bool "btrfs filesystem driver"
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12
help
Build the btrfs filesystem driver for Docker.
comment "brtfs filesystem driver needs headers >= 4.12"
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12
config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER
bool "devicemapper filesystem driver"
depends on BR2_TOOLCHAIN_HAS_THREADS # lvm2
@@ -83,11 +80,11 @@ config BR2_PACKAGE_DOCKER_ENGINE_DOCKER_INIT_NAME
endif
comment "docker-engine needs a glibc or musl toolchain w/ threads, headers >= 3.17"
comment "docker-engine needs a glibc or musl toolchain w/ threads, headers >= 5.2"
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on BR2_PACKAGE_LIBSECCOMP_ARCH_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_THREADS || \
BR2_TOOLCHAIN_USES_UCLIBC || \
!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
!BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_2
depends on BR2_USE_MMU

View File

@@ -79,8 +79,9 @@ config BR2_PACKAGE_MENDER_UPDATE_MODULES_DOCKER
depends on BR2_TOOLCHAIN_HAS_THREADS # docker-engine, docker-cli
depends on !BR2_TOOLCHAIN_USES_UCLIBC # containerd -> runc
depends on BR2_USE_MMU # containerd
depends on !BR2_PACKAGE_CGROUPFS_MOUNT # docker-engine
depends on BR2_PACKAGE_LIBSECCOMP_ARCH_SUPPORTS # libseccomp
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # libseccom
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_2 # docker-engine
select BR2_PACKAGE_DOCKER_ENGINE
select BR2_PACKAGE_DOCKER_CLI
select BR2_PACKAGE_JQ # runtime
@@ -97,13 +98,13 @@ config BR2_PACKAGE_MENDER_UPDATE_MODULES_DOCKER
https://github.com/mendersoftware/mender-update-modules/tree/master/docker
comment "docker support needs a glibc or musl toolchain w/ threads, headers >= 3.17"
comment "docker support needs a glibc or musl toolchain w/ threads, headers >= 5.2"
depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
depends on BR2_PACKAGE_LIBSECCOMP_ARCH_SUPPORTS
depends on !BR2_TOOLCHAIN_HAS_THREADS || \
BR2_TOOLCHAIN_USES_UCLIBC || \
!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
!BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_2
depends on BR2_USE_MMU
config BR2_PACKAGE_MENDER_UPDATE_MODULES_IPK