summaryrefslogtreecommitdiffstats
path: root/recipes-containers/vcontainer/vdkr-rootfs-image.bb
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-01-06 20:42:46 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-02-09 03:32:52 +0000
commit18074e0efe255a43ab9155171d08aa6e0d736b5f (patch)
tree25411491f3a6c3ed7b3460a0bd9f3d4d1c561bc6 /recipes-containers/vcontainer/vdkr-rootfs-image.bb
parentc32db56912b06a89490fda5d554468dbc12a39a2 (diff)
downloadmeta-virtualization-18074e0efe255a43ab9155171d08aa6e0d736b5f.tar.gz
vcontainer: add vdkr Docker support
Add vdkr - Docker CLI wrapper for cross-architecture container operations: Scripts: - vdkr.sh: Docker CLI entry point (vdkr-x86_64, vdkr-aarch64) - vdkr-init.sh: Docker init script for QEMU guest Recipes: - vdkr-native: Installs vdkr CLI wrappers - vdkr-rootfs-image: Builds Docker rootfs with containerd, runc, skopeo - vdkr-initramfs-create: Creates bootable initramfs blob The vdkr CLI provides Docker-compatible commands executed inside a QEMU-emulated environment, enabling cross-architecture container operations during Yocto builds. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/vcontainer/vdkr-rootfs-image.bb')
-rw-r--r--recipes-containers/vcontainer/vdkr-rootfs-image.bb74
1 files changed, 74 insertions, 0 deletions
diff --git a/recipes-containers/vcontainer/vdkr-rootfs-image.bb b/recipes-containers/vcontainer/vdkr-rootfs-image.bb
new file mode 100644
index 00000000..a9bbb9fa
--- /dev/null
+++ b/recipes-containers/vcontainer/vdkr-rootfs-image.bb
@@ -0,0 +1,74 @@
1# SPDX-FileCopyrightText: Copyright (C) 2025 Bruce Ashfield
2#
3# SPDX-License-Identifier: MIT
4#
5# vdkr-rootfs-image.bb
6# Minimal Docker-capable image for vdkr QEMU environment
7#
8# This image is built via multiconfig and used by vdkr-initramfs-create
9# to provide a proper rootfs for running Docker in QEMU.
10#
11# Build with:
12# bitbake mc:vdkr-aarch64:vdkr-rootfs-image
13# bitbake mc:vdkr-x86-64:vdkr-rootfs-image
14
15SUMMARY = "Minimal Docker rootfs for vdkr"
16DESCRIPTION = "A minimal image containing Docker tools for use with vdkr. \
17 This image runs inside QEMU to provide Docker command execution."
18
19LICENSE = "MIT"
20LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
21
22# Track init script changes via file-checksums
23# This adds the file content hash to the task signature
24do_rootfs[file-checksums] += "${THISDIR}/files/vdkr-init.sh:True"
25do_rootfs[file-checksums] += "${THISDIR}/files/vcontainer-init-common.sh:True"
26
27# Force do_rootfs to always run (no stamp caching)
28# Combined with file-checksums, this ensures init script changes are picked up
29do_rootfs[nostamp] = "1"
30
31# Inherit from core-image-minimal for a minimal base
32inherit core-image
33
34# We need Docker and container tools
35IMAGE_INSTALL = " \
36 packagegroup-core-boot \
37 docker-moby \
38 containerd \
39 runc \
40 skopeo \
41 busybox \
42 iproute2 \
43 util-linux \
44"
45
46# No extra features needed
47IMAGE_FEATURES = ""
48
49# Keep the image small
50IMAGE_ROOTFS_SIZE = "524288"
51IMAGE_ROOTFS_EXTRA_SPACE = "0"
52
53# Use squashfs for smaller size (~3x compression)
54# The preinit mounts squashfs read-only with tmpfs overlay for writes
55IMAGE_FSTYPES = "squashfs"
56
57# Install our init script
58ROOTFS_POSTPROCESS_COMMAND += "install_vdkr_init;"
59
60install_vdkr_init() {
61 # Install vdkr-init.sh as /init and vcontainer-init-common.sh alongside it
62 install -m 0755 ${THISDIR}/files/vdkr-init.sh ${IMAGE_ROOTFS}/init
63 install -m 0755 ${THISDIR}/files/vcontainer-init-common.sh ${IMAGE_ROOTFS}/vcontainer-init-common.sh
64
65 # Create required directories
66 install -d ${IMAGE_ROOTFS}/mnt/input
67 install -d ${IMAGE_ROOTFS}/mnt/state
68 install -d ${IMAGE_ROOTFS}/var/lib/docker
69 install -d ${IMAGE_ROOTFS}/run/containerd
70
71 # Create skopeo policy
72 install -d ${IMAGE_ROOTFS}/etc/containers
73 echo '{"default":[{"type":"insecureAcceptAnything"}]}' > ${IMAGE_ROOTFS}/etc/containers/policy.json
74}