From 9462ef117712b7d1ac258576902c291e5742a369 Mon Sep 17 00:00:00 2001 From: Harsh Mathur Date: Tue, 7 Jul 2026 06:07:55 +0000 Subject: [PATCH 1/2] fix: add non-free apt sources for nvidia-cuda-toolkit on Bookworm The python:3.12-slim-bookworm base image only has main and non-free-firmware components enabled. nvidia-cuda-toolkit lives in non-free, which is not included by default in Debian Bookworm slim images. Add deb http://deb.debian.org/debian bookworm non-free to sources.list before the GPU install block so ENABLE_GPU=true builds don't fail with "Package has no installation candidate". Also fixes a stray trailing space after apt-get clean. Fixes #2020 --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6434ff730..f632f51c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,9 +90,10 @@ RUN apt-get update && apt-get dist-upgrade -y \ && rm -rf /var/lib/apt/lists/* RUN if [ "$ENABLE_GPU" = "true" ] && [ "$TARGETARCH" = "amd64" ] ; then \ - apt-get update && apt-get install -y --no-install-recommends \ + echo "deb http://deb.debian.org/debian bookworm non-free" >> /etc/apt/sources.list \ + && apt-get update && apt-get install -y --no-install-recommends \ nvidia-cuda-toolkit \ - && apt-get clean \ + && apt-get clean \ && rm -rf /var/lib/apt/lists/* ; \ else \ echo "Skipping NVIDIA CUDA Toolkit installation (unsupported platform or GPU disabled)"; \ From 65e0430425ad02e0ee878e31f1541c73490581d9 Mon Sep 17 00:00:00 2001 From: Harsh Mathur Date: Wed, 8 Jul 2026 16:43:31 +0000 Subject: [PATCH 2/2] fix: include contrib apt source for CUDA toolkit --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f632f51c4..68238357b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,7 +90,7 @@ RUN apt-get update && apt-get dist-upgrade -y \ && rm -rf /var/lib/apt/lists/* RUN if [ "$ENABLE_GPU" = "true" ] && [ "$TARGETARCH" = "amd64" ] ; then \ - echo "deb http://deb.debian.org/debian bookworm non-free" >> /etc/apt/sources.list \ + echo "deb http://deb.debian.org/debian bookworm contrib non-free" >> /etc/apt/sources.list \ && apt-get update && apt-get install -y --no-install-recommends \ nvidia-cuda-toolkit \ && apt-get clean \