nix module: default container.defaultImage to a digest-pinned buildpack-deps:stable-scm #230
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#230
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Container spawns on a stock module deployment refuse with:
because
container.defaultImagedefaults tonull(nix/module.nix) and the production host config never sets it. ADR-0053 made the global image optional; this issue keeps that demotion but makes the module ship a working default so a fresh deployment can spawn container sessions out of the box.Decision
The NixOS module defaults
container.defaultImageto a digest-pinneddocker.io/library/buildpack-deps:stable-scm@sha256:…. That image satisfies the dev-image contract as-is (shell, coreutils, git, openssh-client, curl, ca-certificates; anonymous pull from docker.io). The Go binary's--container-imageflag default stays empty — lab-the-binary still ships no image of its own; the module is the opinionated deployment layer, exactly as it already is fortoolsImages.nullremains a valid explicit value (opt-out: per-repo-only deployments per ADR-0053 stay supported), and a repo's ownimage_refstill overrides the global.Work
container.defaultImage's default fromnullto the pinned ref, written as a literal. Resolve the digest at implementation time:skopeo inspect --format '{{.Digest}}' docker://docker.io/library/buildpack-deps:stable-scmand store it as
docker.io/library/buildpack-deps:stable-scm@sha256:…(tag kept for readability). Put the exact re-pin command in a comment beside the literal — re-pinning is a manual PR, no automation.--container-image(currently ~lines 328-337 and 422-429): the default unit must now carry the pinned ref. Add/adjust a check proving an explicitdefaultImage = nullrenders no--container-image(opt-out preserved). Keep the explicit-override fixture (~line 104) on a different ref (debian:stable-slimis fine) so it proves the override wins over the new default.container.defaultImage(no longernull) and the Container-runner prose. Also fix the self-contradiction in "Dev image expectations": it namesdebian:stable-slimas a qualifying example, but the same paragraph requiresgitand an ssh client, which that image does not ship — name images that actually meet the contract (e.g.buildpack-deps:stable-scm,alpinewith the needed packages added).Rejected alternatives (from the design discussion)
rg/jquserland.Acceptance
nix flake checkpasses with the flipped assertions.--container-image docker.io/library/buildpack-deps:stable-scm@sha256:…in ExecStart; explicitdefaultImage = nullrenders none.image_refon a default deployment spawns instead of refusing.