@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 8ef6b8a38c
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

Always use cache mounts when installing vllm to avoid populating pip cache in the image. Also remove apt cache. (#23270)

Signed-off-by: Valentyn Tymofieiev <valentyn@google.com>

tvalentyn committed Aug 22, 2025 at 00:01 UTC 8ef6b8a38cc3b69e55b0bb60d5442c4efb1988de
1 file changed +8 -3
docker/Dockerfile.tpu
+8 -3
@@ -7,7 +7,8 @@ WORKDIR /workspace/vllm
7 # Install some basic utilities
8 RUN apt-get update && apt-get install -y \
9 git \
10 - ffmpeg libsm6 libxext6 libgl1
10 + ffmpeg libsm6 libxext6 libgl1 && \
11 + rm -rf /var/lib/apt/lists/*
12
13 # Build vLLM.
14 COPY . .
@@ -16,6 +17,9 @@ RUN --mount=type=bind,source=.git,target=.git \
17 if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi
18
19 # Remove existing versions of dependencies
20 +# TODO: These packages will remain as dead weight in the Docker image layers.
21 +# We should find a way to build the image without uninstalling these.
22 +# Consider using a different base image.
23 RUN pip uninstall -y torch torch_xla torchvision
24
25 ENV VLLM_TARGET_DEVICE="tpu"
@@ -23,9 +27,10 @@ RUN --mount=type=cache,target=/root/.cache/pip \
27 --mount=type=bind,source=.git,target=.git \
28 python3 -m pip install \
29 -r requirements/tpu.txt
26 -RUN python3 -m pip install -e .
30 +
31 +RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install -e .
32
33 # install development dependencies (for testing)
29 -RUN python3 -m pip install -e tests/vllm_test_utils
34 +RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install -e tests/vllm_test_utils
35
36 CMD ["/bin/bash"]