commit 8af704b5839c72333f5b7a9a207b81cb4ad5f11a
parent 34fc8988e586cc2abf579fd6067a36b48f94d03a
Author: Divan Visagie <me@divanv.com>
Date: Fri, 20 Nov 2026 22:33:13 +0100
make publish: build the real image and push it to registry.sectorflabs.com
linux/publish.sh builds the Containerfile's system target (not the test VM's dev one, which has a login and trusts the development registry) and pushes it to the private registry on urd with skopeo, reading from Docker's daemon so every layer is OCI (bootc rejects the Docker-typed layers docker push leaves in an OCI manifest). Two tags: latest, and a UTC timestamp copied inside the registry. The Makefile heading no longer says Ubuntu.
Diffstat:
2 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,12 +1,11 @@
-# Patina OS: build the Linux (Ubuntu bootc) image and run it in a VM.
-# These wrap the scripts in linux/vm/ (see linux/vm/README.md).
-# Needs Docker, QEMU with KVM and OVMF.
+# Sector F Linux: build the image (Fedora bootc on Btrfs), run it in a VM, and publish it.
+# These wrap the scripts in linux/ (see linux/vm/README.md). Needs Docker, QEMU with KVM and OVMF.
VM := linux/vm/vm.sh
DISK := linux/out/disk.raw
.DEFAULT_GOAL := help
-.PHONY: help build disk run console stop ssh view screenshot log upgrade rollback clean distclean
+.PHONY: help build publish disk run console stop ssh view screenshot log upgrade rollback clean distclean
help: ## List the targets
@grep -E '^[a-zA-Z_-]+:.*## ' $(MAKEFILE_LIST) | \
@@ -15,6 +14,9 @@ help: ## List the targets
build: ## Build the desktop and the image, and push it to the local registry
linux/vm/build.sh
+publish: ## Build the real image (not the VM's dev one) and push it to registry.example.com (tailnet only)
+ linux/publish.sh
+
disk: ## Install the image onto linux/out/disk.raw (replaces the disk)
linux/vm/disk.sh
diff --git a/linux/publish.sh b/linux/publish.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+# Builds the real image, the Containerfile's `system` target and not the test VM's `dev` one (which
+# has a login and trusts the development registry), and pushes it to the private registry on the registry host
+# (the infrastructure repo), where machines follow it with `bootc switch`.
+#
+# linux/publish.sh
+#
+# PUBLISH_REPO is where it goes (default registry.example.com/sectorf-linux); it is reachable
+# from the tailnet only. Two tags are pushed: latest, and a UTC timestamp to go back to.
+#
+# The push goes through skopeo, from Docker's own daemon, and not `docker push`: Docker pushes an
+# OCI manifest whose own layers carry Docker's media type, which bootc rejects on an upgrade
+# ("Unhandled layer type"); skopeo writes every layer as OCI. See vm/build.sh, and ADR-0009.
+set -euo pipefail
+
+ROOT=$(cd "$(dirname "$0")" && pwd)
+REPO=${PUBLISH_REPO:-registry.example.com/sectorf-linux}
+STAMP=$(date -u +%Y%m%d-%H%M%S)
+LOCAL="$REPO:build"
+
+say() { printf '==> %s\n' "$*"; }
+
+"$ROOT/desktop/build.sh"
+
+say "building the system image"
+docker build -f "$ROOT/Containerfile" --target system -t "$LOCAL" "$ROOT"
+
+# --network host so the name resolves as it does here (the tailnet's split DNS), and the real
+# certificate is checked: nothing here is insecure.
+say "pushing $REPO:latest, with OCI layers"
+docker run --rm --network host -v /var/run/docker.sock:/var/run/docker.sock "$LOCAL" \
+ skopeo copy --format oci "docker-daemon:$LOCAL" "docker://$REPO:latest" >/dev/null
+
+# The second tag is the same manifest: copied inside the registry, so nothing is uploaded again.
+say "tagging $REPO:$STAMP"
+docker run --rm --network host "$LOCAL" \
+ skopeo copy "docker://$REPO:latest" "docker://$REPO:$STAMP" >/dev/null
+
+say "done: $REPO:latest and $REPO:$STAMP (machines on the tailnet: bootc switch $REPO:latest)"