From f2472dcdc52de398eccc829d88b400e587d6f934 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Fri, 23 Jan 2026 15:22:28 -0500 Subject: vcontainer: fix runc/crun conflict in multiconfig builds The vruntime distro is used for multiconfig builds of both vdkr (Docker/runc) and vpdmn (Podman/crun) images. When CONTAINER_PROFILE or VIRTUAL-RUNTIME_container_runtime is set, containerd and podman pull their preferred runtime via RDEPENDS, causing package conflicts. Fix by having vruntime distro NOT participate in CONTAINER_PROFILE: - Set VIRTUAL-RUNTIME_container_runtime="" to prevent automatic runtime selection - Explicitly install runc in vdkr-rootfs-image.bb - Explicitly install crun in vpdmn-rootfs-image.bb This allows both images to be built in the same multiconfig without conflicts, while standard container-host images continue to use CONTAINER_PROFILE normally. Also add kernel-modules to vdkr-rootfs-image for overlay filesystem support. Signed-off-by: Bruce Ashfield --- conf/distro/vruntime.conf | 19 +++++++++++++++++-- recipes-containers/vcontainer/vdkr-rootfs-image.bb | 3 +++ recipes-containers/vcontainer/vpdmn-rootfs-image.bb | 13 +++---------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/conf/distro/vruntime.conf b/conf/distro/vruntime.conf index a10df80f..a489a7a2 100644 --- a/conf/distro/vruntime.conf +++ b/conf/distro/vruntime.conf @@ -7,8 +7,10 @@ # This distro is used by multiconfig builds (vruntime-aarch64, vruntime-x86-64) # to create minimal rootfs images for QEMU-based container processing. # -# The resulting images contain Docker or Podman tools and are used by -# vrunner.sh to import containers during Yocto image builds. +# IMPORTANT: This distro does NOT participate in CONTAINER_PROFILE. +# The vdkr/vpdmn rootfs images explicitly specify their container stacks +# to avoid conflicts between docker (runc) and podman (crun) requirements. +# This allows both to be built in the same multiconfig. require conf/distro/poky.conf @@ -45,3 +47,16 @@ VIRTUAL-RUNTIME_login_manager = "" # Keep images small - no documentation or debug EXTRA_IMAGE_FEATURES = "" + +# ============================================================================= +# Container runtime: NOT SET +# ============================================================================= +# Unlike normal container distros, vruntime does NOT set CONTAINER_PROFILE +# or VIRTUAL-RUNTIME_container_runtime. This prevents containerd/podman from +# pulling a specific runtime via RDEPENDS, avoiding conflicts when both +# vdkr (runc) and vpdmn (crun) are built in the same multiconfig. +# +# The vdkr-rootfs-image and vpdmn-rootfs-image recipes explicitly install +# their required runtimes in IMAGE_INSTALL. +# ============================================================================= +VIRTUAL-RUNTIME_container_runtime = "" diff --git a/recipes-containers/vcontainer/vdkr-rootfs-image.bb b/recipes-containers/vcontainer/vdkr-rootfs-image.bb index 4a0c8a10..8dcf4190 100644 --- a/recipes-containers/vcontainer/vdkr-rootfs-image.bb +++ b/recipes-containers/vcontainer/vdkr-rootfs-image.bb @@ -38,6 +38,8 @@ do_rootfs[nostamp] = "1" inherit core-image # We need Docker and container tools +# Note: runc is explicitly listed because vruntime distro sets +# VIRTUAL-RUNTIME_container_runtime="" to avoid runc/crun conflicts. IMAGE_INSTALL = " \ packagegroup-core-boot \ docker-moby \ @@ -48,6 +50,7 @@ IMAGE_INSTALL = " \ iproute2 \ iptables \ util-linux \ + kernel-modules \ " # No extra features needed diff --git a/recipes-containers/vcontainer/vpdmn-rootfs-image.bb b/recipes-containers/vcontainer/vpdmn-rootfs-image.bb index 82dd64ba..644ce14d 100644 --- a/recipes-containers/vcontainer/vpdmn-rootfs-image.bb +++ b/recipes-containers/vcontainer/vpdmn-rootfs-image.bb @@ -31,21 +31,14 @@ do_rootfs[nostamp] = "1" # Inherit from core-image-minimal for a minimal base inherit core-image -# Use crun as the OCI runtime (not runc) - this prevents the conflict where -# both crun (which creates /usr/bin/runc symlink) and runc package are installed -VIRTUAL-RUNTIME_container_runtime = "crun" - -# Use netavark for container networking (pulled in via podman's RDEPENDS) -VIRTUAL-RUNTIME_container_networking = "netavark" - -# Use aardvark-dns for container DNS -VIRTUAL-RUNTIME_container_dns = "aardvark-dns" - # We need Podman and container tools # Podman is daemonless - no containerd required! +# Note: crun is explicitly listed because vruntime distro sets +# VIRTUAL-RUNTIME_container_runtime="" to avoid runc/crun conflicts. IMAGE_INSTALL = " \ packagegroup-core-boot \ podman \ + crun \ skopeo \ conmon \ netavark \ -- cgit v1.2.3-54-g00ecf