Slim runtime binaries and omit unused curl libraries

This commit is contained in:
Dymas committed 2026-10-27 17:10:56 +01:00
1 parent aad5f14386
commit b20ac19343
5 files changed
+20 -4

No files matched your search

+7
View File
@@ -1,5 +1,12 @@
# Changelog
## 0.55.10 — 2026-10-27
- Reduce Docker runtime size by stripping native debug symbols from the Node 24 and curl-impersonate binaries in the build stage. Keep binutils out of the runtime image and retain curl's browser wrappers.
- Stop copying unused curl shared/static libraries into the image; the bundled command-line client embeds its curl implementation and only needs the existing system runtime libraries. Keep the full FFmpeg package and existing media support.
- Retain the 0.55.9 security fixes, runtime versions, data directories, configuration, watchlists, queue history, thumbnails, downloads, and Jellyfin content.
- Checked providers against upstream revision `5a1de84ad651d088cf427655573a96500151d862`; no new active-provider updates were available. AniNeko remains retired upstream with its compatibility adapter retained.
## 0.55.9 — 2026-10-27
- Update locked HTTP dependencies to undici 6.29.1 and follow-redirects 1.16.2 to address the reported npm security advisories while retaining the existing compatible dependency ranges.
+6 -2
View File
@@ -4,6 +4,11 @@ FROM node:24-bookworm-slim AS node_dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev && npm cache clean --force
RUN apt-get update \
&& apt-get install -y --no-install-recommends binutils \
&& rm -rf /var/lib/apt/lists/*
COPY --from=curl_impersonate /usr/local/bin/ /out/curl/
RUN strip --strip-unneeded /usr/local/bin/node /out/curl/curl-impersonate
FROM python:3.12-slim-bookworm
@@ -30,8 +35,7 @@ RUN apt-get update \
&& python -c 'import ensurepip, pathlib, shutil; shutil.rmtree(pathlib.Path(ensurepip.__file__).parent)' \
&& rm -rf /var/lib/apt/lists/*
COPY --from=curl_impersonate /usr/local/bin/ /usr/local/bin/
COPY --from=curl_impersonate /usr/local/lib/ /usr/local/lib/
COPY --from=node_dependencies /out/curl/ /usr/local/bin/
RUN mkdir -p /app
+4
View File
@@ -29,6 +29,10 @@ docker compose up -d --build
Prebuilt image: `gitea.coreplay.eu/dymas/kaizoku:latest` (also tagged by release version). The Docker image uses a separate build stage for npm dependencies to keep the runtime image smaller.
From 0.55.10, the build stage strips native debug symbols from Node and curl-impersonate and copies only curl's command-line binary and browser wrappers. Unused curl shared/static libraries and the stripping tools stay outside the runtime image. Runtime versions and the full FFmpeg media package are retained.
On amd64, the measured uncompressed image size decreased from 1.05 GiB in 0.55.9 to about 970 MiB in 0.55.10, saving approximately 100 MiB (9.4%). Registry download sizes and other architectures may differ.
The 0.55.9 security update includes undici 6.29.1, follow-redirects 1.16.2, Node 24 LTS, and refreshed Debian timezone data. The runtime image omits unused pip and its ensurepip bootstrap wheel; Kaizoku's Python code uses only the standard library. Custom images that need additional Python packages should install them in a separate build stage. Pull the updated image and recreate the container to replace the affected packages; restarting the existing container does not update its image. For local image builds, use `docker compose build --pull --no-cache kaizoku` to refresh base images and system package installation. Reuse all existing volume mounts and their contents.
The full Trivy scan on 2026-10-27 found none of the 11 reported advisories, no npm/Python package vulnerabilities, and no findings with an available fixed version in its database. Unfixed Debian advisories, including critical-severity entries, remain and require separate base-image or component work.
+1 -1
View File
@@ -1 +1 @@
0.55.9
0.55.10
+2 -1
View File
@@ -5726,7 +5726,8 @@ class TemplateHelperTests(unittest.TestCase):
self.assertIn("COPY --from=node_dependencies /app/node_modules /app/node_modules", dockerfile)
self.assertIn("npm ci --omit=dev", dockerfile)
self.assertIn("FROM lexiforest/curl-impersonate:v2.2.2 AS curl_impersonate", dockerfile)
self.assertIn("COPY --from=curl_impersonate /usr/local/bin/ /usr/local/bin/", dockerfile)
self.assertIn("COPY --from=curl_impersonate /usr/local/bin/ /out/curl/", dockerfile)
self.assertIn("COPY --from=node_dependencies /out/curl/ /usr/local/bin/", dockerfile)
self.assertIn("LD_LIBRARY_PATH=/usr/local/lib", dockerfile)
def test_docker_compose_exposes_jellyfin_browse_roots(self):