No description
  • Dockerfile 58.4%
  • Shell 41.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christophe Varoqui 4c01b91b0b
All checks were successful
/ version (push) Successful in 2s
/ build (push) Successful in 35s
Publish a version once, and pin the actions and images of the build
The templates pin the image by digest, which a second push of its tag
would orphan: the push of main on a tagged commit and the push of the tag
both published 1.26.2-1, the second replacing the first. The version job
now asks the registry whether the version is published: the push of a tag
fails when it is, and a commit of main a tag names updates latest only.
Rebuilding a version takes a new revision tag.

actions/checkout is pinned to the commit of v4.4.0, and the kaniko image to
its digest.
2026-12-02 00:31:41 +01:00
.forgejo/workflows Publish a version once, and pin the actions and images of the build 2026-12-02 00:31:41 +01:00
etc Unbound 1.26.2 in a distroless image, for the OpenSVC DNS template v4 2026-12-01 20:04:38 +01:00
.gitignore Unbound 1.26.2 in a distroless image, for the OpenSVC DNS template v4 2026-12-01 20:04:38 +01:00
Dockerfile Unbound 1.26.2 in a distroless image, for the OpenSVC DNS template v4 2026-12-01 20:04:38 +01:00
LICENSE Unbound 1.26.2 in a distroless image, for the OpenSVC DNS template v4 2026-12-01 20:04:38 +01:00
README.md Publish a version once, and pin the actions and images of the build 2026-12-02 00:31:41 +01:00
test.sh Unbound 1.26.2 in a distroless image, for the OpenSVC DNS template v4 2026-12-01 20:04:38 +01:00
unbound.conf Unbound 1.26.2 in a distroless image, for the OpenSVC DNS template v4 2026-12-01 20:04:38 +01:00

Unbound for OpenSVC clusters

build

Unbound, the cluster nameserver of the OpenSVC DNS template v4, in a distroless image.

On each node of a cluster, Unbound is the secondary of the cluster zone and of the reverse zones of the cluster networks, which it transfers from the om daemon of its node, and resolves the names outside the cluster. It keeps its copy of the zones while the daemon is down, so a restart or an upgrade of the daemons, all at once included, does not stop the resolution.

Image

The image is built by the forge workflow and served by the package registry of the forge:

docker pull forge.opensvc.com/opensvc/unbound:latest
  • latest is the image of the last commit of main.
  • <version>, as 1.26.2-1, is the image of a tag, or of a commit of main no tag names, the version git describe says. A tag is the Unbound version, then the revision of the image for that version.

A version is published once: the templates pin its digest, which a second push of the tag would orphan. The push of a tag fails when the registry holds its version already, and a commit of main a tag names updates latest only. Rebuilding a version, as for a security fix of a library linked in, takes a new revision tag, as 1.26.2-2. The actions and images the workflow runs are pinned by digest.

Content

  • /usr/sbin/unbound and /usr/sbin/unbound-checkconf, Unbound fully static, built from the source of the NLnet Labs release the UNBOUND_VERSION argument of the Dockerfile names, checked against UNBOUND_SHA256.
  • /etc/unbound/unbound.conf, a resolver of the loopback for the loopback, which the OpenSVC DNS template replaces with its own.
  • The gcr.io/distroless/static-debian13 base: no shell, no package manager.

Privileges

Unbound runs as the opensvc-dns user, uid and gid 64953, allowed to bind port 53 by a file capability on its binary. Run the container with that capability alone:

docker run --cap-drop ALL --cap-add NET_BIND_SERVICE ...

The uid and gid 64953 are ones no distribution allocates: the zone copies the container writes on the host belong to no host user. The file capability survives a build with docker, and with kaniko from v1.29: kaniko v1.28.5 drops it.

A configuration of your own sets username: "" and chroot: "": the container is already unprivileged.

Build and test

docker build -t container-unbound .
./test.sh

test.sh builds the image, unless SKIP_BUILD is set, starts it with NET_BIND_SERVICE alone on 127.0.0.1:553, and checks Unbound answers there as uid 64953. It needs docker, dig, and that port free.

Update

  • Unbound: set UNBOUND_VERSION and UNBOUND_SHA256 from the unbound-<version>.tar.gz.sha256 file NLnet Labs publishes beside the release, then tag <version>-1.
  • The bases: the alpine build stage and the distroless runtime stage are pinned by digest; update both digests together, then tag the next revision.

Signing

The images of the forge registry are not signed: the keyless signing of Cosign rests on the OIDC identity of the CI, which Forgejo Actions does not provide.