From 8dc2e7d2f11aee4e70c3675e4ba6dd255a47e0e4 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Wed, 23 Sep 2026 11:51:44 +0200 Subject: web: ship glibc C.utf8 so the web TUI shows åäö MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cross-built bokftui is static glibc; in the Alpine web image it found no locale data, setlocale() failed and åäö were invalid bytes. The cross build now copies Debian's C.utf8 into the image and the image build runs bokfweb --check-locale, so a TUI without UTF-8 fails the build. Co-Authored-By: Claude Opus 5.5 --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index a46e15e..5102a42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,9 @@ RUN if [ -x .prebuilt/bokfd ]; then \ VERSION="$VERSION" \ && make test-core VERSION="$VERSION"; \ fi \ - && strip build/bokfd build/bokfctl build/bokftui build/bokfweb + && strip build/bokfd build/bokfctl build/bokftui build/bokfweb \ + && mkdir -p build/locale \ + && if [ -d .prebuilt/locale ]; then cp -a .prebuilt/locale/. build/locale/; fi # The web frontend (image bokf-web, `--target web`): Caddy for routing, the # bokfweb login gate, ttyd and bokftui in web mode. It reaches bokfd only @@ -36,9 +38,13 @@ RUN apk add --no-cache ca-certificates caddy ttyd ncurses-terminfo-base \ && addgroup -S bokfd \ && adduser -S -D -H -u 10001 -G bokfd -s /sbin/nologin bokfd COPY --from=build /src/build/bokftui /src/build/bokfweb /usr/local/bin/ +# glibc locale data for the cross-built static binaries (empty for a native +# musl build, which needs none); the check fails the build without UTF-8 +COPY --from=build /src/build/locale/ /usr/lib/locale/ COPY deploy/bokftui-web deploy/web-entrypoint.sh /usr/local/bin/ COPY deploy/Caddyfile /etc/caddy/Caddyfile -RUN chmod 0755 /usr/local/bin/bokftui-web /usr/local/bin/web-entrypoint.sh +RUN chmod 0755 /usr/local/bin/bokftui-web /usr/local/bin/web-entrypoint.sh \ + && LANG=C.UTF-8 bokfweb --check-locale ENV BOKFD_SOCKET=/run/bokfd/bokfd.sock \ TERM=xterm-256color \ LANG=C.UTF-8 -- cgit v1.3