@@ -327,6 +327,20 @@ for recipe, image in container_images.items():
# oci-multiarch; doubles as the multiarch marker and
# the OCI layout path for skopeo below.
"_OCI_MULTIARCH_OUTPUT=$(echo \"$_BBENV\" | awk -F'\"' '/^OCI_MULTIARCH_OUTPUT=/{ print $2; exit }')",
+ # Drives the '-dev' tag suffix below (dhi.io convention: same image
+ # name, tag suffixed) for recipes built with PACKAGECONFIG:pn-<recipe> = "dev".
+ #
+ # $recipe here is the BBTARGET from CONTAINER_IMAGE_MAP, which on the
+ # multiarch path is the container-image-multiarch wrapper (e.g.
+ # container-image-multiarch-app-container-nginx) — a different PN
+ # than app-container-nginx, so 'PACKAGECONFIG:pn-app-container-nginx'
+ # never touches its PACKAGECONFIG. OCI_MULTIARCH_RECIPE (already
+ # extracted above) is the underlying app recipe name and is what
+ # PACKAGECONFIG:pn-<recipe> actually targets; fall back to $recipe
+ # itself for single-arch recipes (OCI_MULTIARCH_RECIPE empty there).
+ "_PC_RECIPE=\"${_OCI_MULTIARCH_RECIPE:-%s}\"" % recipe,
+ "_PC_BBENV=$(bitbake -e \"$_PC_RECIPE\" 2>/dev/null) || true",
+ "_PACKAGECONFIG=$(echo \"$_PC_BBENV\" | awk -F'\"' '/^PACKAGECONFIG=/{ print $2; exit }')",
"_EXTRA_TAGS=\"\"",
]
if version_recipe:
@@ -348,6 +362,18 @@ for recipe, image in container_images.items():
script.append(
"_TAGS=\"%s $_PV $_DISTRO_CODENAME yocto-$_DISTRO_VERSION $_EXTRA_TAGS\"" % " ".join(static_tags)
)
+ # 'dev' builds (PACKAGECONFIG:pn-<recipe> = "dev") push under the same
+ # image name as production, with every tag suffixed '-dev' (dhi.io
+ # convention), instead of a separate image name/repo.
+ script += [
+ "case \" $_PACKAGECONFIG \" in",
+ " *\" dev \"*)",
+ " _DEVTAGS=\"\"",
+ " for _t in $_TAGS; do _DEVTAGS=\"$_DEVTAGS ${_t}-dev\"; done",
+ " _TAGS=\"$_DEVTAGS\"",
+ " ;;",
+ "esac",
+ ]
# Detect multiarch vs single-arch per recipe and push accordingly,
# but only for an image whose build actually produced its OCI artefact.
#
For containers which set PACKAGECONFIG 'dev', push additional container images with '-dev' suffix to the tags. Inspired by dhi.io (Docker Hardened Images). Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- scripts/run-push-containers | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)