2026-01-25 21:35:57 -08:00
|
|
|
# kiwix-serve container
|
|
|
|
|
# Downloads pre-built binary from kiwix mirror
|
|
|
|
|
|
2026-03-05 08:12:32 -08:00
|
|
|
ARG CONTAINER_APP_VERSION=3.8.2
|
2026-02-20 22:50:01 -08:00
|
|
|
|
2026-02-13 17:16:37 -08:00
|
|
|
FROM alpine:3.22
|
2026-01-25 21:35:57 -08:00
|
|
|
|
|
|
|
|
ARG TARGETPLATFORM
|
2026-02-20 22:50:01 -08:00
|
|
|
ARG CONTAINER_APP_VERSION
|
|
|
|
|
ARG KIWIX_VERSION=${CONTAINER_APP_VERSION}
|
2026-01-25 21:35:57 -08:00
|
|
|
|
|
|
|
|
RUN set -e && \
|
|
|
|
|
apk --no-cache add dumb-init curl && \
|
|
|
|
|
# Detect architecture - use TARGETPLATFORM if set, otherwise detect from uname
|
|
|
|
|
if [ -n "$TARGETPLATFORM" ]; then \
|
|
|
|
|
echo "TARGETPLATFORM: $TARGETPLATFORM"; \
|
|
|
|
|
case "$TARGETPLATFORM" in \
|
|
|
|
|
linux/arm64*) ARCH="aarch64" ;; \
|
|
|
|
|
linux/amd64*) ARCH="x86_64" ;; \
|
|
|
|
|
*) ARCH="" ;; \
|
|
|
|
|
esac; \
|
|
|
|
|
else \
|
|
|
|
|
echo "TARGETPLATFORM not set, detecting from uname..."; \
|
|
|
|
|
UNAME_ARCH=$(uname -m); \
|
|
|
|
|
echo "uname -m: $UNAME_ARCH"; \
|
|
|
|
|
case "$UNAME_ARCH" in \
|
|
|
|
|
aarch64|arm64) ARCH="aarch64" ;; \
|
|
|
|
|
x86_64) ARCH="x86_64" ;; \
|
|
|
|
|
*) ARCH="" ;; \
|
|
|
|
|
esac; \
|
|
|
|
|
fi && \
|
|
|
|
|
if [ -z "$ARCH" ]; then \
|
|
|
|
|
echo "ERROR: Unsupported architecture"; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi && \
|
|
|
|
|
url="http://mirror.download.kiwix.org/release/kiwix-tools/kiwix-tools_linux-$ARCH-$KIWIX_VERSION.tar.gz" && \
|
|
|
|
|
echo "URL: $url" && \
|
|
|
|
|
curl -k -L $url | tar -xz -C /usr/local/bin/ --strip-components 1 && \
|
|
|
|
|
apk del curl
|
|
|
|
|
|
2026-03-18 20:42:00 -07:00
|
|
|
ARG CONTAINER_APP_VERSION
|
|
|
|
|
LABEL org.opencontainers.image.title="kiwix-serve"
|
|
|
|
|
LABEL org.opencontainers.image.description="Kiwix content server for offline ZIM files"
|
|
|
|
|
LABEL org.opencontainers.image.version="${CONTAINER_APP_VERSION}"
|
|
|
|
|
LABEL org.opencontainers.image.source="https://forge.eblu.me/eblume/blumeops"
|
|
|
|
|
LABEL org.opencontainers.image.vendor="blumeops"
|
|
|
|
|
|
2026-01-25 21:35:57 -08:00
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
|
|
# Run as non-root
|
|
|
|
|
RUN adduser -D -u 1000 kiwix
|
|
|
|
|
USER kiwix
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|
|
|
|
CMD ["/bin/sh", "-c", "echo 'Use: kiwix-serve [options] <zim-files>' && kiwix-serve --help"]
|