summaryrefslogtreecommitdiffstats
path: root/recipes-containers/container-registry/README.md
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-01-12 21:12:03 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-02-09 03:32:52 +0000
commit68320b2c0a6751bf54ae9376d6e1e1dab30c0376 (patch)
tree88c9e017796b496dc34099a6ee1df5b123b3f229 /recipes-containers/container-registry/README.md
parent8b19fa53399cdeb18b1cdd41276ecac5a4f659b0 (diff)
downloadmeta-virtualization-68320b2c0a6751bf54ae9376d6e1e1dab30c0376.tar.gz
container-registry: add management commands and documentation
Registry management commands: - delete <image>:<tag>: Remove tagged images from registry - gc: Garbage collection with dry-run preview and confirmation - push <image> --tag: Explicit tags now require image name (prevents accidentally tagging all images with same version) Config improvements: - Copy config to storage directory with baked-in storage path - Fixes gc which reads config directly (not via env var) - All registry files now in ${TOPDIR}/container-registry/ Documentation: - Development Loop workflow (build, push, pull, test) - Build-time OCI labels (revision, branch, created) - Complete command reference Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/container-registry/README.md')
-rw-r--r--recipes-containers/container-registry/README.md68
1 files changed, 64 insertions, 4 deletions
diff --git a/recipes-containers/container-registry/README.md b/recipes-containers/container-registry/README.md
index 82932706..1a0f74eb 100644
--- a/recipes-containers/container-registry/README.md
+++ b/recipes-containers/container-registry/README.md
@@ -34,8 +34,10 @@ Script location: `${TOPDIR}/container-registry/container-registry.sh` (outside t
34| `start` | Start the container registry server | 34| `start` | Start the container registry server |
35| `stop` | Stop the container registry server | 35| `stop` | Stop the container registry server |
36| `status` | Check if registry is running | 36| `status` | Check if registry is running |
37| `push [options]` | Push all OCI images from deploy/ to registry | 37| `push [image] [options]` | Push OCI images from deploy/ to registry |
38| `import <image> [name]` | Import 3rd party image to registry | 38| `import <image> [name]` | Import 3rd party image to registry |
39| `delete <image>:<tag>` | Delete a tagged image from registry |
40| `gc` | Garbage collect unreferenced blobs |
39| `list` | List all images with their tags | 41| `list` | List all images with their tags |
40| `tags <image>` | List tags for a specific image | 42| `tags <image>` | List tags for a specific image |
41| `catalog` | Raw API catalog output | 43| `catalog` | Raw API catalog output |
@@ -43,9 +45,9 @@ Script location: `${TOPDIR}/container-registry/container-registry.sh` (outside t
43### Push Options 45### Push Options
44 46
45```bash 47```bash
46# Explicit tags 48# Explicit tags (require image name)
47container-registry.sh push --tag v1.0.0 49container-registry.sh push container-base --tag v1.0.0
48container-registry.sh push --tag latest --tag v1.0.0 50container-registry.sh push container-base --tag latest --tag v1.0.0
49 51
50# Strategy-based (see Tag Strategies below) 52# Strategy-based (see Tag Strategies below)
51container-registry.sh push --strategy "sha branch latest" 53container-registry.sh push --strategy "sha branch latest"
@@ -89,6 +91,64 @@ Result: `my-app:1.2.3`, `my-app:1.2`, `my-app:1`, `my-app:latest`
89IMAGE_VERSION=1.2.3 container-registry.sh push --strategy "semver sha latest" 91IMAGE_VERSION=1.2.3 container-registry.sh push --strategy "semver sha latest"
90``` 92```
91 93
94## Development Loop
95
96The default strategy (`timestamp latest`) supports a simple development workflow:
97
98```bash
99# Build
100bitbake container-base
101
102# Push (creates both timestamp tag AND :latest)
103./container-registry/container-registry.sh push
104
105# Pull on target - :latest is implicit, gets your most recent push
106vdkr pull container-base
107
108# Test
109vdkr run container-base /bin/sh
110
111# Repeat: rebuild, push, pull - no tag hunting needed
112```
113
114Each push overwrites `:latest` with your newest build. The timestamp tags (`20260112-143022`) remain for rollback/debugging.
115
116## Build-Time OCI Labels
117
118Container images automatically include standard OCI traceability labels:
119
120```bash
121$ skopeo inspect oci:container-base-oci | jq '.Labels'
122{
123 "org.opencontainers.image.revision": "8a3f2b1",
124 "org.opencontainers.image.ref.name": "master",
125 "org.opencontainers.image.created": "2026-01-12T20:32:24Z"
126}
127```
128
129| Label | Source | Description |
130|-------|--------|-------------|
131| `org.opencontainers.image.revision` | git SHA from TOPDIR | Code traceability |
132| `org.opencontainers.image.ref.name` | git branch from TOPDIR | Branch tracking |
133| `org.opencontainers.image.created` | Build timestamp | When image was built |
134| `org.opencontainers.image.version` | PV (if set) | Semantic version |
135
136### Customizing Labels
137
138```bitbake
139# In local.conf or image recipe
140
141# Explicit override (e.g., from CI/CD)
142OCI_IMAGE_REVISION = "${CI_COMMIT_SHA}"
143OCI_IMAGE_BRANCH = "${CI_BRANCH}"
144
145# Disable specific label
146OCI_IMAGE_REVISION = "none"
147
148# Disable all auto-labels
149OCI_IMAGE_AUTO_LABELS = "0"
150```
151
92## Configuration (local.conf) 152## Configuration (local.conf)
93 153
94```bitbake 154```bitbake