Distribute a template over an OCI registry
§ 1Purpose
Push a stored template to a registry and pull it on another machine.
§ 2Prerequisites
- The template exists in the local store.
- You can authenticate to the registry.
§ 3Flowchart
§ 4Steps
§ 4.11
§ 4.2Log in
$ vmlab template login ghcr.io -u myuser -p <token>
Docker creds reused
If the machine already has a docker login for the registry, no separate login is needed.
Run vmlab template login <registry> (persists to ~/.docker/config.json).
§ 4.32
§ 4.4Push
$ vmlab template push x86_64/linux-modern@1.0 ghcr.io/owner/linux-modern:1.0
Push the local store ref to a registry ref. The qcow2 is chunked into zstd layers (512 MiB default). Push the same name from each arch to build a multi-arch index.
§ 4.53
§ 4.6Pull elsewhere
$ vmlab template pull ghcr.io/owner/linux-modern:1.0 --arch x86_64
Arch is never assumed
Pulling an ambiguous multi-arch index without --arch is an error.
On the target machine, vmlab template pull <ref> reassembles the chunks and verifies the whole-image SHA-256 before installing to the store. A registry ref used directly in a lab is pulled on vmlab up if absent.
Verification
vmlab template list on the target machine shows the pulled <arch>/<name>@<version> ref.