- Dockerfile 58.4%
- Shell 41.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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. |
||
| .forgejo/workflows | ||
| etc | ||
| .gitignore | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
| test.sh | ||
| unbound.conf | ||
Unbound for OpenSVC clusters
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
latestis the image of the last commit ofmain.<version>, as1.26.2-1, is the image of a tag, or of a commit ofmainno tag names, the versiongit describesays. 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/unboundand/usr/sbin/unbound-checkconf, Unbound fully static, built from the source of the NLnet Labs release theUNBOUND_VERSIONargument of the Dockerfile names, checked againstUNBOUND_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-debian13base: 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_VERSIONandUNBOUND_SHA256from theunbound-<version>.tar.gz.sha256file NLnet Labs publishes beside the release, then tag<version>-1. - The bases: the
alpinebuild 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.