summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-06-12 17:54:14 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-06-12 17:54:14 +0000
commit2a9af619193139594e5150bd1fd4f175ce186cab (patch)
tree9e05093d32bb234ddac4cd0e1b4ad57759f689df
parent27e41b91d68d4adb6cd967871c59fd1e32830fe6 (diff)
downloadmeta-virtualization-2a9af619193139594e5150bd1fd4f175ce186cab.tar.gz
app-container-multilayer: drop redundant IMAGE_INSTALL
The canonical multi-layer demo recipe listed every package in two places — once in OCI_LAYERS and again in IMAGE_INSTALL — and carried a four-line comment block explaining why the duplication was needed to trigger do_rootfs's recrdeptask. The matching bbclass change folds OCI_LAYERS packages: layers into IMAGE_INSTALL automatically, so the duplication is no longer needed and the explanatory comment for the old workaround is no longer accurate. Drop the IMAGE_INSTALL line and the obsolete comment. Replace them with a short note in-line with OCI_LAYERS that describes the new behaviour and tells readers when they would still need to add to IMAGE_INSTALL themselves (e.g. for packages used only by a rootfs postprocess fixup that don't land in any final layer). Functional verification on qemux86-64: 1. Snapshot the existing build (with explicit IMAGE_INSTALL): cp -a tmp/deploy/images/qemux86-64/app-container-multilayer-...-oci /tmp/baseline ls -1 /tmp/baseline/blobs/sha256/ | sort > /tmp/baseline.txt 2. Edit recipe (drop IMAGE_INSTALL), cleansstate, rebuild. 3. Compare blob digest lists. Result: all three OCI image layer blobs (the actual container content, ~16 MB total) match byte-for-byte between the two builds. Only the config and manifest blobs differ, which is expected — they embed the build timestamp via org.opencontainers.image.created and reference the new config digest. No layer content drift. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-demo/images/app-container-multilayer.bb13
1 files changed, 7 insertions, 6 deletions
diff --git a/recipes-demo/images/app-container-multilayer.bb b/recipes-demo/images/app-container-multilayer.bb
index 6a3f2042..a32c299c 100644
--- a/recipes-demo/images/app-container-multilayer.bb
+++ b/recipes-demo/images/app-container-multilayer.bb
@@ -14,6 +14,13 @@ OCI_LAYERS = "\
14 app:packages:curl \ 14 app:packages:curl \
15" 15"
16 16
17# Note: no IMAGE_INSTALL needed for the packages listed above.
18# image-oci.bbclass walks OCI_LAYERS at parse time and folds every
19# package named in a ":packages:" layer into IMAGE_INSTALL automatically,
20# so do_rootfs's recrdeptask builds them. A recipe only needs to set
21# IMAGE_INSTALL itself for packages that are NOT named in any layer
22# (e.g. packages consumed only by a rootfs postprocess fixup).
23
17# Use CMD so `docker run image /bin/sh` works as expected 24# Use CMD so `docker run image /bin/sh` works as expected
18OCI_IMAGE_CMD = "/bin/sh -c 'echo Hello from multi-layer container && curl --version'" 25OCI_IMAGE_CMD = "/bin/sh -c 'echo Hello from multi-layer container && curl --version'"
19 26
@@ -25,12 +32,6 @@ IMAGE_FEATURES = ""
25IMAGE_LINGUAS = "" 32IMAGE_LINGUAS = ""
26NO_RECOMMENDATIONS = "1" 33NO_RECOMMENDATIONS = "1"
27 34
28# IMAGE_INSTALL triggers package builds via do_rootfs recrdeptask.
29# Even for multi-layer mode, list packages here to ensure they're built.
30# The PM will install them directly to layers from DEPLOY_DIR_IPK.
31# Note: IMAGE_ROOTFS is still created but ignored for packages layers.
32IMAGE_INSTALL = "base-files base-passwd netbase busybox curl"
33
34# Allow build with or without a specific kernel 35# Allow build with or without a specific kernel
35IMAGE_CONTAINER_NO_DUMMY = "1" 36IMAGE_CONTAINER_NO_DUMMY = "1"
36 37