Author SHA1 Message Date
sneak 743d24da1f Quiet the update-alternatives man page warnings in the image build (closes #222)
check / check (push) Successful in 5m44s
xz-utils' install, which nix-bin depends on, calls update-alternatives to
link its man pages, but the image's dpkg config drops man pages the moment
they unpack, so it prints one warning for each link it cannot make. A config
file read after that one re-includes man pages for this install alone; the
cleanup then removes the man pages and the links and directories they added,
so the image holds exactly what it held before, and installs built from it
still drop them.

Model: deepseek-v4-pro
2026-11-07 13:15:57 +00:00
4 changed files with 18 additions and 30 deletions

No files matched your search

+18 -16
View File
@@ -124,20 +124,6 @@ RUN git checkout --quiet --detach b4b2c785308b1ce785b6155c7fe5f16879080193 \
# ubuntu 26.04, 2026-09-27 # ubuntu 26.04, 2026-09-27
FROM ubuntu@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7 FROM ubuntu@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7
# The image's own labels, in place of the ones it would inherit from
# Ubuntu's. script/docker and script/cibuild pass the build arguments;
# a build that passes none labels the image unknown rather than leave
# Ubuntu's values.
ARG VERSION=unknown
ARG CREATED=unknown
ARG REVISION=unknown
LABEL org.opencontainers.image.title="smallwebwaf" \
org.opencontainers.image.description="A web application firewall for self-hosted web apps: sww rproxy in front of an app, and sww discriminator, which decides." \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.created="${CREATED}" \
org.opencontainers.image.revision="${REVISION}" \
org.opencontainers.image.source="https://git.eeqj.de/sneak/smallwebwaf"
# runit's install creates its _runit-log user with minsysusers, which # runit's install creates its _runit-log user with minsysusers, which
# reads this file in place of runit's /usr/lib/sysusers.d/runit.conf. # reads this file in place of runit's /usr/lib/sysusers.d/runit.conf.
# runit's line leaves out the shell, and minsysusers prints a Perl # runit's line leaves out the shell, and minsysusers prints a Perl
@@ -150,10 +136,26 @@ RUN mkdir /etc/sysusers.d \
# ca-certificates, nix-bin and runit, from Ubuntu's archive. apt fetches # ca-certificates, nix-bin and runit, from Ubuntu's archive. apt fetches
# them over plain HTTP and checks each one against the archive's signed # them over plain HTTP and checks each one against the archive's signed
# package lists, so no CA certificates are needed. # package lists, so no CA certificates are needed.
RUN apt-get update \ #
# The image's dpkg config drops man pages as each package unpacks, so
# xz-utils' install, which nix-bin depends on, prints an update-alternatives
# warning for every man-page link it cannot make. This side file re-includes
# them for this install alone; it is read after /etc/dpkg/dpkg.cfg.d/excludes,
# so it overrides the drop and the links are made quietly. The cleanup below
# removes the man pages and the links and directories they added, then puts
# the base image's empty man directories back. The image holds exactly what
# it held before, and installs built from it still drop man pages.
RUN find /usr/share/man -mindepth 1 -type d > /tmp/base-man-dirs \
&& echo 'path-include=/usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/z-man \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \ && DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
ca-certificates nix-bin runit \ ca-certificates nix-bin runit \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/* /etc/dpkg/dpkg.cfg.d/z-man \
&& find /usr/share/man ! -type d -delete \
&& find /etc/alternatives -type l -xtype l -delete \
&& find /usr/share/man -mindepth 1 -type d -empty -delete \
&& xargs -a /tmp/base-man-dirs mkdir -p \
&& rm /tmp/base-man-dirs
# Nix run by root expects a group of build users, which nix-bin does not # Nix run by root expects a group of build users, which nix-bin does not
# create; with the setting empty, root's builds run without them. # create; with the setting empty, root's builds run without them.
-4
View File
@@ -9,10 +9,6 @@
ARG SWW_IMAGE=smallwebwaf ARG SWW_IMAGE=smallwebwaf
FROM ${SWW_IMAGE} FROM ${SWW_IMAGE}
# Its own title and description, in place of the smallwebwaf image's.
LABEL org.opencontainers.image.title="smallwebwaf-example-app" \
org.opencontainers.image.description="An example app built on the smallwebwaf image."
# Packages the app needs, from the nixpkgs in the image. # Packages the app needs, from the nixpkgs in the image.
RUN nix-env -iA nixpkgs.busybox RUN nix-env -iA nixpkgs.busybox
-5
View File
@@ -20,13 +20,8 @@ main() {
# the version a build stage derives from the .git in the context. # the version a build stage derives from the .git in the context.
version="$(git describe --tags --always --dirty 2>/dev/null || true)" version="$(git describe --tags --always --dirty 2>/dev/null || true)"
[ -n "$version" ] || version="unknown" [ -n "$version" ] || version="unknown"
revision="$(git rev-parse HEAD 2>/dev/null || true)"
[ -n "$revision" ] || revision="unknown"
created="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
docker build --no-cache \ docker build --no-cache \
--build-arg VERSION="$version" \ --build-arg VERSION="$version" \
--build-arg REVISION="$revision" \
--build-arg CREATED="$created" \
-t "$("$SCRIPT_DIR/projectname")" . -t "$("$SCRIPT_DIR/projectname")" .
} }
-5
View File
@@ -16,13 +16,8 @@ main() {
# the version a build stage derives from the .git in the context. # the version a build stage derives from the .git in the context.
version="$(git describe --tags --always --dirty 2>/dev/null || true)" version="$(git describe --tags --always --dirty 2>/dev/null || true)"
[ -n "$version" ] || version="unknown" [ -n "$version" ] || version="unknown"
revision="$(git rev-parse HEAD 2>/dev/null || true)"
[ -n "$revision" ] || revision="unknown"
created="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
docker build --no-cache \ docker build --no-cache \
--build-arg VERSION="$version" \ --build-arg VERSION="$version" \
--build-arg REVISION="$revision" \
--build-arg CREATED="$created" \
-t "$("$SCRIPT_DIR/projectname")" . -t "$("$SCRIPT_DIR/projectname")" .
} }