From 3364640cb72d04c5f0f2f104add9159bab9eb352 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 15:02:02 +0000 Subject: [PATCH 1/2] Initial plan From 7311110e3415c2dc2b4b60eaf8097beca66dae4a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 27 Nov 2025 15:06:42 +0000 Subject: [PATCH 2/2] Add documentation for Alpine Linux Docker usage Co-authored-by: timvink <5570380+timvink@users.noreply.github.com> --- docs/howto/use-in-alpine-docker.md | 36 ++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 37 insertions(+) create mode 100644 docs/howto/use-in-alpine-docker.md diff --git a/docs/howto/use-in-alpine-docker.md b/docs/howto/use-in-alpine-docker.md new file mode 100644 index 0000000..1a0da96 --- /dev/null +++ b/docs/howto/use-in-alpine-docker.md @@ -0,0 +1,36 @@ +# Use in Alpine Linux Docker + +When using this plugin in a Docker container based on Alpine Linux, you may encounter the following error: + +```text +LookupError: Unknown timezone UTC +``` + +This happens because Alpine Linux, being a minimal distribution, does not include timezone data by default. The [babel](https://github.com/python-babel/babel) library used by this plugin requires timezone information to function correctly. + +## Solution + +Install the `tzdata` package in your Alpine-based Docker image: + +```dockerfile +# Install timezone data +RUN apk add --no-cache tzdata +``` + +!!! example "Example Dockerfile" + + ```dockerfile + FROM python:3.12-alpine + + # Install timezone data for babel/mkdocs-git-revision-date-localized-plugin + RUN apk add --no-cache tzdata git + + # Install MkDocs and plugins + RUN pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin + + WORKDIR /docs + ``` + +!!! tip "Why this is needed" + + The Python `zoneinfo` module relies on system-level timezone data to resolve timezone names like "UTC". Without the `tzdata` package installed, Alpine Linux does not have this data available, causing the `LookupError`. diff --git a/mkdocs.yml b/mkdocs.yml index 5859daa..a4550bf 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -10,6 +10,7 @@ nav: - howto/specify-locale.md - howto/custom-styling.md - howto/override-a-theme.md + - howto/use-in-alpine-docker.md - options.md theme: