@@ -39,11 +39,9 @@ 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 dnf upgrade -y && dnf install -y \
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 \
4343 cuda-cudart-12-6-${NV_CUDA_CUDART_VERSION} \
44- cuda-compat-12-6 \
45- && dnf clean all \
46- && rm -rf /var/cache/yum/*
44+ cuda-compat-12-6
4745
4846# nvidia-docker 1.0
4947RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
@@ -69,21 +67,17 @@ ENV NV_LIBNCCL_VERSION=2.23.4
6967ENV NCCL_VERSION=2.23.4
7068ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}-${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.6
7169
72- RUN dnf install -y \
70+ RUN --mount=type=cache,target=/var/cache/ dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
7371 cuda-libraries-12-6-${NV_CUDA_LIB_VERSION} \
7472 cuda-nvtx-12-6-${NV_NVTX_VERSION} \
7573 ${NV_LIBNPP_PACKAGE} \
7674 libcublas-12-6-${NV_LIBCUBLAS_VERSION} \
77- ${NV_LIBNCCL_PACKAGE} \
78- && dnf clean all \
79- && rm -rf /var/cache/yum/*
75+ ${NV_LIBNCCL_PACKAGE}
8076
8177# Install devel tools
82- RUN dnf install -y \
78+ RUN --mount=type=cache,target=/var/cache/ dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
8379 make \
84- findutils \
85- && dnf clean all \
86- && rm -rf /var/cache/yum/*
80+ findutils
8781
8882# Install CUDA cudnn9 from:
8983# https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/12.6.3/ubi9/runtime/cudnn/Dockerfile
@@ -92,17 +86,14 @@ ENV NV_CUDNN_PACKAGE=libcudnn9-cuda-12-${NV_CUDNN_VERSION}
9286
9387LABEL com.nvidia.cudnn.version="${NV_CUDNN_VERSION}"
9488
95- RUN dnf install -y \
96- ${NV_CUDNN_PACKAGE} \
97- && dnf clean all \
98- && rm -rf /var/cache/yum/*
89+ RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf install -y --setopt=keepcache=1 \
90+ ${NV_CUDNN_PACKAGE}
9991
10092# Set this flag so that libraries can find the location of CUDA
10193ENV XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/local/cuda
10294
10395# Install CUDA toolkit 12.6
104- RUN dnf -y install cuda-toolkit-12-6 && \
105- dnf -y clean all --enablerepo="*"
96+ RUN --mount=type=cache,target=/var/cache/dnf,sharing=locked,id=notebooks-dnf dnf -y install --setopt=keepcache=1 cuda-toolkit-12-6
10697
10798# Restore user workspace
10899USER 1001
0 commit comments