cocoonbox

Box image

The box is a desktop template on the sandboxd host: cbcore:vN. The older cbdesk:vN family is frozen: its boxes keep the agent their image carries, and cut.sh refuses it. This page is the build, versioning and publishing flow.

Recipe

Piece Where
guest provisioning (Xorg, XFCE, Chrome, users, units) image/provision.sh, image/rootfs/
the desk runtime of cbcore (desk API, gui_plan, routing) image/desk/
the agent the cocoonbox-agent binary of the same release
cut, seal, export image/cut.sh, image/seal.sh, image/export-rootfs.sh
guest gate image/clean-gate.sh

Cut

A version is cut from the previous one on a host that runs the box’s sandboxd instance (deploy/cbsbx/):

sudo image/cut.sh -f cbcore -a cocoonbox-agent-linux-amd64 [-p] cbcore:v(N-1) vN

cut.sh boots the base template, reruns provision.sh with -p, installs the agent, runs the guest gate, seals, stops, exports a flat rootfs tarball with export-rootfs.sh and imports it as cbcore:vN with cocoon image import. The tarball stays under the instance’s build/ directory.

A runtime is a directory with a provision.sh; each -r <dir> copies one into the guest and runs its provision.sh after the base step, in the order given, and the family, cbcore unless -f names another, uses image/desk without -r. -f takes any family name ([a-z][a-z0-9]*): -f <family> -r image/desk -r <dir> cuts <family>:vN from a template with the desk runtime plus another one, such as a directory outside this repository. The guest gate runs for cbcore only. -n prints the steps a cut would run, in order, and changes nothing; make image (in the gate workflow) checks that list with image/test/cut-dry-run.sh: the -r order, the cbcore default and the refusals, cbdesk among them. cua-driver comes with the shuttle archive as shuttle’s child; the desk provision removes a template’s own cua-driver and masks its unit, which keeps a restored home’s wants link inert.

Versions and pins

Publishing

cocoonstack publishes guest images as OCI images on ghcr (ghcr.io/cocoonstack/..., built from Dockerfiles by Actions, such as sandbox/base with an immutable 24.04-<sha> and a moving 24.04). The box is cut from a booted VM instead, so its publish step runs where the cut runs: