From e3b1cbbb86997881f5984b7a6afa2716cf898a61 Mon Sep 17 00:00:00 2001 From: Joseph Young <130690493+yousecjoe@users.noreply.github.com> Date: Sun, 17 Mar 2024 02:27:06 -0400 Subject: [PATCH] Parametrize CUDA_VERSION in Dockerfile Standardized CUDA_VERSION as a global ARG to ensure consistency and facilitate version updates across the Dockerfile. This change allows the CUDA version to be defined once at the beginning and reused, reducing the chance of mismatched versions and easing maintenance when changing CUDA versions. It further streamlines the build process for potential multi-stage builds with varying CUDA dependencies. Refs #nvidia-update --- Dockerfile-cuda | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile-cuda b/Dockerfile-cuda index a785e5f0..5bd0c377 100644 --- a/Dockerfile-cuda +++ b/Dockerfile-cuda @@ -1,4 +1,5 @@ # syntax=docker/dockerfile:1 +ARG CUDA_VERSION=12.3.2 ######## WebUI frontend ######## FROM node:21-alpine3.19 as build @@ -23,8 +24,8 @@ RUN npm run build #RUN OPENWEBUI_CPU_TARGET="cpu_avx2" sh gen_linux.sh ######## CUDA WebUI backend ######## -ARG CUDA_VERSION=12.3.2 -FROM --platform=linux/amd64 nvidia/cuda:$CUDA_VERSION-devel-ubuntu22.04 AS cuda-build-amd64 +FROM --platform=linux/amd64 nvidia/cuda:"$CUDA_VERSION"-devel-ubuntu22.04 AS cuda-build-amd64 + # Set environment variables for NVIDIA Container Toolkit ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 \ NVIDIA_DRIVER_CAPABILITIES=all \