summaryrefslogtreecommitdiffstats
path: root/recipes-containers/oci-base-images
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-01-14 04:47:15 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-02-09 03:32:52 +0000
commit4ddc9e489307a31b25600b9073edb09110740fb8 (patch)
tree528a535e8c3afd0784bdae385e3ff7f52ad15b20 /recipes-containers/oci-base-images
parentfb238ac545516cacd05b085335f249a806261644 (diff)
downloadmeta-virtualization-4ddc9e489307a31b25600b9073edb09110740fb8.tar.gz
recipes: add multi-layer OCI example recipes
Add example recipes demonstrating multi-layer OCI image building: alpine-oci-base_3.19.bb: - Fetches Alpine 3.19 from Docker Hub using container-bundle - Uses CONTAINER_BUNDLE_DEPLOY for use as OCI_BASE_IMAGE source - Pinned digest for reproducible builds app-container-alpine.bb: - Demonstrates external base image usage - Layers Yocto packages (busybox) on top of Alpine - Uses OCI_IMAGE_CMD for Docker-like behavior app-container-layered.bb: - Demonstrates local base image usage - Layers Yocto packages on top of container-base - Uses OCI_IMAGE_CMD for Docker-like behavior Both app containers produce 2-layer OCI images where the base layer is shared, reducing storage and transfer costs. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/oci-base-images')
-rw-r--r--recipes-containers/oci-base-images/alpine-oci-base_3.19.bb31
1 files changed, 31 insertions, 0 deletions
diff --git a/recipes-containers/oci-base-images/alpine-oci-base_3.19.bb b/recipes-containers/oci-base-images/alpine-oci-base_3.19.bb
new file mode 100644
index 00000000..706ffb2a
--- /dev/null
+++ b/recipes-containers/oci-base-images/alpine-oci-base_3.19.bb
@@ -0,0 +1,31 @@
1# SPDX-License-Identifier: MIT
2#
3# Alpine OCI base image for use with OCI_BASE_IMAGE
4#
5# This recipe fetches Alpine Linux from Docker Hub and deploys it to
6# DEPLOY_DIR_IMAGE for use as a base layer in multi-layer OCI builds.
7#
8# Usage in your container recipe:
9# OCI_BASE_IMAGE = "alpine-oci-base"
10# IMAGE_INSTALL = "base-files busybox myapp"
11#
12# The Alpine layers will be preserved, and your IMAGE_INSTALL packages
13# are added as an additional layer on top.
14
15SUMMARY = "Alpine Linux OCI base image"
16DESCRIPTION = "Fetches Alpine Linux from Docker Hub for use as an OCI base layer"
17HOMEPAGE = "https://alpinelinux.org/"
18LICENSE = "MIT"
19LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
20
21inherit container-bundle
22
23# Remote container from Docker Hub
24CONTAINER_BUNDLES = "docker.io/library/alpine:3.19"
25
26# REQUIRED: Pinned digest for reproducible builds
27# Get with: skopeo inspect docker://docker.io/library/alpine:3.19 | jq -r '.Digest'
28CONTAINER_DIGESTS[docker.io_library_alpine_3.19] = "sha256:6baf43584bcb78f2e5847d1de515f23499913ac9f12bdf834811a3145eb11ca1"
29
30# Enable deployment to DEPLOY_DIR_IMAGE for use as OCI base layer
31CONTAINER_BUNDLE_DEPLOY = "1"