Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(docker): add public Wolfi apk repo to runtime image (#39033)

devin-ai-integration[bot]97dbd8efcb1c
diff --git a/Dockerfile b/Dockerfile
index b3ee85e9ed1..29a085a4ef9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -101,6 +101,12 @@ FROM $LITELLM_RUNTIME_IMAGE AS runtime
USER root
+# The base image only configures Chainguard's authenticated apk repo, which
+# requires an enterprise subscription. Add the public Wolfi repo so `apk add`
+# also works for anyone installing extra packages into a running container.
+# https://github.com/BerriAI/litellm/issues/33518
+RUN echo "https://packages.wolfi.dev/os" >> /etc/apk/repositories
+
# node (without npm) is required by the prisma CLI at runtime
RUN apk add --no-cache bash openssl tzdata nodejs python-3.13 libsndfile
diff --git a/tests/test_litellm/test_dockerfile_apk_repository.py b/tests/test_litellm/test_dockerfile_apk_repository.py
new file mode 100644
index 00000000000..cbd772defbf
--- /dev/null
+++ b/tests/test_litellm/test_dockerfile_apk_repository.py
@@ -0,0 +1,52 @@
+"""
+Static checks on the root Dockerfile's apk repository configuration.
+
+The base image (cgr.dev/chainguard/wolfi-base) only configures the
+authenticated Chainguard apk repo (https://apk.cgr.dev/chainguard) in
+/etc/apk/repositories, which requires a Chainguard enterprise subscription.
+Anyone pulling the published litellm image and running `apk add` inside it
+hits SSL/auth failures with no fallback repo configured, so nothing can be
+installed. See https://github.com/BerriAI/litellm/issues/33518
+"""
+
+import os
+import re
+
+import pytest
+
+DOCKERFILE_PATH = os.path.join(
+ os.path.dirname(__file__),
+ "..",
+ "..",
+ "Dockerfile",
+)
+
+
+def _runtime_stage(dockerfile_text: str) -> str:
+ """Return the contents of the final `FROM ... AS runtime` build stage."""
+ match = re.search(r"^FROM .*\bAS runtime\b(.*)\Z", dockerfile_text, re.MULTILINE | re.DOTALL)
+ assert match, "Dockerfile has no `FROM ... AS runtime` stage"
+ return match.group(1)
+
+
+ not os.path.exists(DOCKERFILE_PATH),
+ reason="Dockerfile not present in this checkout",
+)
+def test_runtime_stage_adds_public_wolfi_repo():
+ """The runtime stage must add the public Wolfi apk repo so `apk add`
+ works for users without a Chainguard enterprise subscription."""
+ with open(DOCKERFILE_PATH, "r", encoding="utf-8") as f:
+ contents = f.read()
+
+ runtime_stage = _runtime_stage(contents)
+
+ assert re.search(
+ r"echo\s+[\"']?https://packages\.wolfi\.dev/os[\"']?\s*>>\s*/etc/apk/repositories",
+ runtime_stage,
+ ), (
+ "Runtime stage must append the public Wolfi apk repo "
+ '(RUN echo "https://packages.wolfi.dev/os" >> /etc/apk/repositories) '
+ "so `apk add` works without Chainguard enterprise credentials. "
+ "See https://github.com/BerriAI/litellm/issues/33518"
+ )