the image agrees with itself about the timezone (V-545)

compose set TZ=Europe/Samara and Go read it, so clock replies and quiet
hours were already local. But /etc/localtime in the image pointed at
Etc/UTC, so a caller asking the system zone instead of the environment
answered UTC. The reminder path shells out to python dateparser, which is
such a caller.

TZ is now a build arg on the runtime stage. It points the symlink, writes
/etc/timezone and sets ENV TZ, so the image is local on its own. Compose
passes the zone it already declares, so the zone stays written in one
place.
This commit is contained in:
2026-08-05 15:35:23 +04:00
parent c586346a60
commit 1ee9a930d3
2 changed files with 17 additions and 1 deletions
+11
View File
@@ -82,11 +82,22 @@ FROM debian:trixie-slim AS runtime
# tzdata so the TZ env (set in compose) resolves — otherwise Go can't load the
# zone and time.Now() stays UTC, and mavend answers clock/date queries and
# evaluates quiet-hours in UTC.
#
# TZ is a build arg as well as an env because the image was self-inconsistent
# without it (V-545): compose set TZ=Europe/Samara and Go read it, but
# /etc/localtime still pointed at Etc/UTC, so anything asking the system zone
# instead of the environment answered UTC. The reminder path shells out to
# python dateparser, which is exactly such a caller. Compose passes the same
# zone it already declares, so the zone is written in one place.
ARG TZ=Etc/UTC
ENV TZ=$TZ
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libvulkan1 mesa-vulkan-drivers libgomp1 tzdata \
python3 python3-pip && \
pip3 install --no-cache-dir --break-system-packages 'dateparser==1.4.1' && \
apt-get purge -y --auto-remove python3-pip && \
ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && \
echo "$TZ" > /etc/timezone && \
rm -rf /var/lib/apt/lists/*
# runtime native libs: whisper/ggml (incl. vulkan) are real files in deps/lib.