Skip to content

Commit c33ed78

Browse files
committed
Switch to base images instead of devel
This change swithes to the CUDA base images and installs the required development dependencies in this instead of relying on the devel image. This keeps the image size small and makes the build process less prone to CI failures. Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent b5bdbe4 commit c33ed78

4 files changed

Lines changed: 35 additions & 25 deletions

File tree

deployments/container/Dockerfile.ubi9

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM nvcr.io/nvidia/cuda:12.9.1-devel-ubi9 AS builder
15+
FROM nvcr.io/nvidia/cuda:12.9.1-base-ubi9 AS builder
1616

1717
ARG CUDA_VERSION
1818
RUN dnf install -y --allowerasing \
19-
curl cmake \
19+
cmake \
20+
cuda-cudart-devel-12-9 \
21+
cuda-nvcc-12-9 \
22+
g++ \
23+
curl \
2024
&& \
2125
dnf clean all
2226

2327
WORKDIR /build
2428

2529
ARG SAMPLE_NAME
26-
ENV SAMPLE_NAME ${SAMPLE_NAME}
30+
ENV SAMPLE_NAME=${SAMPLE_NAME}
2731
ARG CUDA_SAMPLES_VERSION=v12.9
2832
RUN curl -L https://codeload.github.com/NVIDIA/cuda-samples/tar.gz/refs/tags/${CUDA_SAMPLES_VERSION} | \
2933
tar -xzvf - --strip-components=1 --wildcards */${SAMPLE_NAME}/* --wildcards */Common/* && \

deployments/container/Dockerfile.ubuntu

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM nvcr.io/nvidia/cuda:12.9.1-devel-ubuntu22.04 AS builder
15+
FROM nvcr.io/nvidia/cuda:12.9.1-base-ubuntu22.04 AS builder
1616

1717
ARG SAMPLE_NAME
18-
ENV SAMPLE_NAME ${SAMPLE_NAME}
18+
ENV SAMPLE_NAME=${SAMPLE_NAME}
1919

2020
ARG DEBIAN_FRONTEND=noninteractive
2121
RUN apt-get update && apt-get install -y --no-install-recommends \
22-
curl cmake \
22+
build-essential \
23+
cmake \
24+
cuda-nvcc-12-9 \
25+
g++ \
26+
curl \
2327
&& \
2428
rm -rf /var/lib/apt/lists/*
2529

@@ -36,7 +40,7 @@ RUN curl -L https://codeload.github.com/NVIDIA/cuda-samples/tar.gz/refs/tags/${C
3640
cp ${SAMPLE_NAME} /build/${SAMPLE_NAME}
3741

3842
FROM nvcr.io/nvidia/cuda:12.9.1-base-ubuntu22.04
39-
ARG SAMPLE_NAME=nbody
43+
ARG SAMPLE_NAME
4044
LABEL io.k8s.display-name="NVIDIA CUDA ${SAMPLE_NAME} sample"
4145
LABEL name="NVIDIA CUDA ${SAMPLE_NAME} sample"
4246
LABEL vendor="NVIDIA"

deployments/container/nbody/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM nvcr.io/nvidia/cuda:12.9.1-devel-ubuntu22.04 AS builder
15+
FROM nvcr.io/nvidia/cuda:12.9.1-base-ubuntu22.04 AS builder
1616

1717
ARG SAMPLE_NAME=nbody
1818
ENV SAMPLE_NAME=${SAMPLE_NAME}
1919

2020
ARG DEBIAN_FRONTEND=noninteractive
2121
RUN apt-get update && apt-get install -y --no-install-recommends \
22-
cuda-nvcc-12-6 \
2322
build-essential \
23+
cmake \
24+
cuda-nvcc-12-9 \
2425
g++ \
2526
curl \
2627
freeglut3-dev \
2728
libgl1-mesa-dev \
2829
libglu1-mesa-dev \
29-
cmake \
3030
&& \
3131
rm -rf /var/lib/apt/lists/*
3232

@@ -43,7 +43,7 @@ RUN curl -L https://codeload.github.com/NVIDIA/cuda-samples/tar.gz/refs/tags/${C
4343
cp ${SAMPLE_NAME} /build/${SAMPLE_NAME}
4444

4545
FROM nvcr.io/nvidia/cuda:12.9.1-base-ubuntu22.04
46-
ARG SAMPLE_NAME
46+
ARG SAMPLE_NAME=nbody
4747
LABEL io.k8s.display-name="NVIDIA CUDA ${SAMPLE_NAME} sample"
4848
LABEL name="NVIDIA CUDA ${SAMPLE_NAME} sample"
4949
LABEL vendor="NVIDIA"

deployments/container/nvbandwidth/Dockerfile

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,24 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM nvcr.io/nvidia/cuda:12.9.1-devel-ubuntu22.04 AS builder
16-
17-
ENV DEBIAN_FRONTEND=noninteractive
15+
FROM nvcr.io/nvidia/cuda:12.9.1-base-ubuntu22.04 AS builder
1816

17+
ARG DEBIAN_FRONTEND=noninteractive
1918
RUN apt-get update && apt-get install -y --no-install-recommends \
20-
build-essential \
21-
git \
22-
cmake \
23-
g++ \
24-
gcc \
25-
make \
26-
libboost-program-options-dev \
27-
openmpi-bin \
28-
openmpi-common \
29-
libopenmpi-dev && \
30-
rm -rf /var/lib/apt/lists/*
19+
build-essential \
20+
cmake \
21+
cuda-nvcc-12-9 \
22+
cuda-nvml-dev-12-9 \
23+
g++ \
24+
git \
25+
gcc \
26+
make \
27+
libboost-program-options-dev \
28+
openmpi-bin \
29+
openmpi-common \
30+
libopenmpi-dev \
31+
&& \
32+
rm -rf /var/lib/apt/lists/*
3133

3234
WORKDIR /bandwidthtest
3335

0 commit comments

Comments
 (0)