fix: skip onnx cuda download for cpu image

This commit is contained in:
2026-08-18 17:54:58 +08:00
parent 469f72bdf7
commit 22dd55625f
2 changed files with 40 additions and 10 deletions

View File

@@ -9,6 +9,14 @@ WORKDIR /app
# ---- Stage 2: Dependencies ----
FROM base AS deps
# The npm package bundles the CPU runtime. Linux/x64 otherwise assumes CUDA 12
# and downloads CUDA EP packages from NuGet during postinstall; that download
# is not needed by the CPU ACK images and is fragile behind redirecting proxies.
# A CUDA build must explicitly pass --build-arg ONNXRUNTIME_NODE_INSTALL=cuda12
# and use a CUDA-capable runner image; that path is not enabled by default here.
ARG ONNXRUNTIME_NODE_INSTALL=skip
ENV ONNXRUNTIME_NODE_INSTALL=$ONNXRUNTIME_NODE_INSTALL
# Native build tools for sharp, @napi-rs/canvas
RUN apk add --no-cache python3 build-base g++ cairo-dev pango-dev jpeg-dev giflib-dev librsvg-dev