Skip to content

Commit 7c2a793

Browse files
committed
Dockerfile J-hub singleuser update for gpu.
1 parent c4dbca7 commit 7c2a793

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Dockerfile_singleuser

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,12 @@ RUN apt-get update && apt-get upgrade -y && dpkg --configure -a && \
115115
htop \
116116
libglx-mesa0 libegl1 libxrandr2 libxss1 \
117117
libxcursor1 libxcomposite1 libasound2-dev libxi6 libxtst6 \
118-
ocl-icd-dev ocl-icd-opencl-dev ocl-icd-libopencl1 oclgrind opencl-headers libtiff-dev\
119118
r-base \
120119
libopenblas-dev
121120

122121
# remove newer python version, freeze other versions for max compatibility before updates
123122
# RUN apt --fix-missing purge $(dpkg -l | grep 'python3\.1[01]' | awk '{print $2}')
124123

125-
126-
127124
################################################################################################################################################################
128125
# GPU requirements section
129126

@@ -132,15 +129,19 @@ RUN apt-get update && apt-get upgrade -y && dpkg --configure -a && \
132129
# If you need CuDNN or CUDA user-space libs inside the container, add them here.
133130
# This block only runs for amd64 when GPU_BUILD=true.
134131
RUN if [ "$GPU_BUILD" = "true" ] && [ "$CPU_ARCHITECTURE" = "amd64" ]; then \
135-
echo "GPU build: installing minimal NVIDIA repo metadata (no heavy CUDA toolkit)"; \
136-
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ocl-icd-dev ocl-icd-opencl-dev ocl-icd-libopencl1 oclgrind opencl-headers libtiff-dev build-essential dkms \
137-
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
138-
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
139-
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \
140-
apt-get update && apt-get upgrade -y \
141-
apt-get install -y nvidia-docker2 nvidia-container-toolkit \
132+
install -d -m 0755 /etc/apt/keyrings; \
133+
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
134+
| gpg --dearmor -o /etc/apt/keyrings/nvidia-container-toolkit.gpg; \
135+
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
136+
| sed 's#deb https://#deb [signed-by=/etc/apt/keyrings/nvidia-container-toolkit.gpg] https://#' \
137+
| tee /etc/apt/sources.list.d/nvidia-container-toolkit.list > /dev/null; \
138+
apt-get update; \
139+
# OPTIONAL: only if your code needs OpenCL userspace
140+
apt-get install -y --no-install-recommends \
141+
ocl-icd-libopencl1 ocl-icd-dev opencl-headers libtiff-dev; \
142+
rm -rf /var/lib/apt/lists/*; \
142143
else \
143-
echo "CPU build or non-amd64: skipping NVIDIA steps"; \
144+
echo "CPU build or non-amd64: skipping NVIDIA repo setup"; \
144145
fi
145146

146147
# Not necessary, will corrupt nvidia-doker on install, use with care

0 commit comments

Comments
 (0)