feat(dockerfile): install latest uv from official distroless image

- Copy uv and uvx from ghcr.io/astral-sh/uv:latest into /usr/local/bin to provide a fast package manager at build time without curl, always fetching the newest release. [web:200]
- Keeps image GPU-agnostic and improves cold-starts while entrypoint retains pip fallback for robustness in multiuser environments. [web:185]
This commit is contained in:
clsferguson 2025-09-30 12:10:45 -06:00 committed by GitHub
parent 893e76e908
commit 92c42da226
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& rm cuda-keyring_1.1-1_all.deb
# Install uv (latest) by copying binaries from Astral's official distroless image
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
# Patch CUDA math_functions.h for glibc 2.41 compatibility
RUN sed -i 's/extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x);/extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x) noexcept (true);/' /usr/local/cuda-12.9/include/crt/math_functions.h && \
sed -i 's/extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x);/extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x) noexcept (true);/' /usr/local/cuda-12.9/include/crt/math_functions.h && \
@ -65,7 +68,7 @@ ENV CUDA_HOME=/usr/local/cuda-12.9 \
# Create symlink for compatibility
RUN ln -sf /usr/local/cuda-12.9 /usr/local/cuda
# Create runtime user/group (fix the original issue)
# Create runtime user/group
RUN set -e; \
if getent group 1000 >/dev/null 2>&1; then \
EXISTING_GROUP=$(getent group 1000 | cut -d: -f1); \