diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-10 19:10:52 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-10 21:04:20 +0000 |
| commit | 5ca92e99dc0706c1dcda0edd29aec46a3ccdd851 (patch) | |
| tree | a2bc87ff9c66139e0e08933db023c70300d20b3f /recipes-containers/container-registry/container-registry-index.bb | |
| parent | a4625a1fa2758c0d2496a898ed409b5225efdab1 (diff) | |
| download | meta-virtualization-5ca92e99dc0706c1dcda0edd29aec46a3ccdd851.tar.gz | |
container tasks: move network access out of build chain
yocto-check-layer reports an error for any task between do_fetch and
do_build that has network enabled. Two changes fix this:
container-bundle.bbclass: Move do_fetch_containers from a standalone
task into a do_fetch postfunc. When remote containers are configured,
the anonymous function adds extend_recipe_sysroot as a do_fetch
prefunc (so skopeo-native is available) and do_fetch_containers as a
postfunc. Network access during do_fetch is permitted by the QA check.
container-registry-index: Remove do_container_registry_index from the
build dependency chain (drop "before do_build"). Registry push is a
deployment action requiring explicit invocation:
bitbake container-registry-index -c container_registry_index
The default do_build task now prints usage instructions.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/container-registry/container-registry-index.bb')
| -rw-r--r-- | recipes-containers/container-registry/container-registry-index.bb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/recipes-containers/container-registry/container-registry-index.bb b/recipes-containers/container-registry/container-registry-index.bb index 590e89b3..7d53e28e 100644 --- a/recipes-containers/container-registry/container-registry-index.bb +++ b/recipes-containers/container-registry/container-registry-index.bb | |||
| @@ -84,7 +84,18 @@ python do_container_registry_index() { | |||
| 84 | bb.plain(f"Pushed {len(pushed_refs)} image references to {registry}") | 84 | bb.plain(f"Pushed {len(pushed_refs)} image references to {registry}") |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | addtask do_container_registry_index before do_build | 87 | addtask do_container_registry_index |
| 88 | |||
| 89 | python do_build() { | ||
| 90 | bb.plain("") | ||
| 91 | bb.plain("Container registry push requires explicit invocation (network access") | ||
| 92 | bb.plain("is not permitted during the normal build chain).") | ||
| 93 | bb.plain("") | ||
| 94 | bb.plain("To push OCI images to the registry, run:") | ||
| 95 | bb.plain("") | ||
| 96 | bb.plain(" bitbake container-registry-index -c container_registry_index") | ||
| 97 | bb.plain("") | ||
| 98 | } | ||
| 88 | 99 | ||
| 89 | # Generate a helper script with paths baked in | 100 | # Generate a helper script with paths baked in |
| 90 | # Script is placed alongside registry storage (outside tmp/) so it persists | 101 | # Script is placed alongside registry storage (outside tmp/) so it persists |
