@@ -8,8 +8,9 @@ ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 8.9 9.0+PTX"
88FROM registry.access.redhat.com/ubi9/ubi-minimal:${BASE_UBI_IMAGE_TAG} as base
99ARG PYTHON_VERSION
1010
11- RUN microdnf install -y \
12-     python${PYTHON_VERSION}-pip python${PYTHON_VERSION}-wheel \
11+ RUN --mount=type=cache,target=/var/cache/yum \
12+     microdnf install -y \
13+         python${PYTHON_VERSION}-pip python${PYTHON_VERSION}-wheel \
1314    && microdnf clean all
1415
1516WORKDIR /workspace
@@ -18,7 +19,8 @@ ENV LANG=C.UTF-8 \
1819    LC_ALL=C.UTF-8
1920
2021# Some utils for dev purposes - tar required for kubectl cp
21- RUN microdnf install -y \
22+ RUN --mount=type=cache,target=/var/cache/yum \
23+     microdnf install -y \
2224        which procps findutils tar vim git\
2325    && microdnf clean all
2426
@@ -30,9 +32,12 @@ ARG PYTHON_VERSION
3032
3133ENV VIRTUAL_ENV=/opt/vllm
3234ENV PATH="$VIRTUAL_ENV/bin:$PATH"
33- RUN microdnf install -y \
34-     python${PYTHON_VERSION}-devel python${PYTHON_VERSION}-pip python${PYTHON_VERSION}-wheel && \
35-     python${PYTHON_VERSION} -m venv $VIRTUAL_ENV && pip install --no-cache -U pip wheel uv && microdnf clean all
35+ 
36+ RUN --mount=type=cache,target=/var/cache/yum \
37+     --mount=type=cache,target=/root/.cache/pip \
38+     microdnf install -y \
39+         python${PYTHON_VERSION}-devel python${PYTHON_VERSION}-pip python${PYTHON_VERSION}-wheel && \
40+         python${PYTHON_VERSION} -m venv $VIRTUAL_ENV && pip install --no-cache -U pip wheel uv && microdnf clean all
3641
3742
3843## CUDA Base ###################################################################
@@ -41,7 +46,7 @@ FROM python-install as cuda-base
4146RUN curl -Lo /etc/yum.repos.d/cuda-rhel9.repo \
4247        https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo
4348
44- RUN microdnf install -y  \
49+ RUN --mount=type=cache,target=/var/cache/yum  \
4550    microdnf install -y \
4651        cuda-nvcc-12-4 \
4752        cuda-nvtx-12-4 \
@@ -95,7 +100,11 @@ RUN --mount=type=cache,target=/root/.cache/pip \
95100
96101# install compiler cache to speed up compilation leveraging local or remote caching
97102# git is required for the cutlass kernels
98- RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && rpm -ql epel-release && microdnf install -y git ccache && microdnf clean all
103+ RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
104+     rpm -ql epel-release && \
105+     microdnf install -y git ccache && \
106+     microdnf clean all
107+ 
99108# install build dependencies
100109
101110# copy input files
0 commit comments