[Docker] Compile Python bytecode at image build time (#55422)

Signed-off-by: Nils Matteson <nilsmatteson@icloud.com>
Co-authored-by: Simon Mo <simon.mo@hey.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Nils Matteson
2026-10-01 02:20:17 +00:00
committed by GitHub
co-authored by Simon Mo mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 7314360c9e
commit 76d3929916
8 changed files with 9 additions and 0 deletions
+2
View File
@@ -138,6 +138,8 @@ ENV TARGETARCH=${TARGETARCH}
######################### COMMON BASE IMAGE + PYTHON DEPS #########################
FROM base-common AS base-common-pydeps
ENV UV_COMPILE_BYTECODE=1
# PyTorch provides its own indexes for standard and nightly builds.
# PYTORCH_NIGHTLY=1 builds the CPU image against torch nightly (parity with the
# GPU torch-nightly lane); default 0 keeps the pinned release CPU build.