@@ -39,9 +39,11 @@ RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3
3939ENV CUDA_VERSION=12.6.3
4040
4141# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
42- RUN --mount=type=cache,target=/var/cache/ dnf,sharing=locked,id=notebooks-dnf dnf upgrade -y --setopt=keepcache=1 && dnf install -y --setopt=keepcache=1 \
42+ RUN dnf upgrade -y && dnf install -y \
4343 cuda-cudart-12-6-${NV_CUDA_CUDART_VERSION} \
44- cuda-compat-12-6
44+ cuda-compat-12-6 \
45+ && dnf clean all \
46+ && rm -rf /var/cache/yum/*
4547
4648# nvidia-docker 1.0
4749RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
@@ -67,17 +69,21 @@ ENV NV_LIBNCCL_VERSION=2.23.4
6769ENV NCCL_VERSION=2.23.4
6870ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.6
6971
70- RUN --mount=type=cache,target=/var/cache/ dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
72+ RUN dnf install -y \
7173 cuda-libraries-12-6-${NV_CUDA_LIB_VERSION} \
7274 cuda-nvtx-12-6-${NV_NVTX_VERSION} \
7375 ${NV_LIBNPP_PACKAGE} \
7476 libcublas-12-6-${NV_LIBCUBLAS_VERSION} \
75- ${NV_LIBNCCL_PACKAGE}
77+ ${NV_LIBNCCL_PACKAGE} \
78+ && dnf clean all \
79+ && rm -rf /var/cache/yum/*
7680
7781# Install devel tools
78- RUN --mount=type=cache,target=/var/cache/ dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
82+ RUN dnf install -y \
7983 make \
80- findutils
84+ findutils \
85+ && dnf clean all \
86+ && rm -rf /var/cache/yum/*
8187
8288# Install CUDA cudnn9 from:
8389# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.6.3/ubi9/runtime/cudnn/Dockerfile
@@ -86,14 +92,17 @@ ENV NV_CUDNN_PACKAGE=libcudnn9-cuda-12-${NV_CUDNN_VERSION}
8692
8793LABEL com.nvidia.cudnn.version="${NV_CUDNN_VERSION}"
8894
89- RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
90- ${NV_CUDNN_PACKAGE}
95+ RUN dnf install -y \
96+ ${NV_CUDNN_PACKAGE} \
97+ && dnf clean all \
98+ && rm -rf /var/cache/yum/*
9199
92100# Set this flag so that libraries can find the location of CUDA
93101ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/local/cuda
94102
95103# Install CUDA toolkit 12.6
96- RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf -y install --setopt=keepcache=1 cuda-toolkit-12-6
104+ RUN dnf -y install cuda-toolkit-12-6 && \
105+ dnf -y clean all --enablerepo="*"
97106
98107# Restore user workspace
99108USER 1001
0 commit comments