Distribute a template over an OCI registry

§ 1Purpose

Push a stored template to a registry and pull it on another machine.

§ 2Prerequisites

§ 3Flowchart

1. Log in2. Push3. Pull elsewhere

§ 4Steps

§ 4.11

§ 4.2Log in

console
$ 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

console
$ 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

console
$ 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.