brucefan1983-cuda-programming
SUCCESS
6m 03s
History Source
SummaryIterations1Transcript7Dockerfile
Dockerfile32 lines · 846 chars
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04

# Use the NVIDIA CUDA development image to have nvcc available
ENV LANG=C.UTF-8

# Install build tools
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        build-essential \
        ca-certificates \
        g++ \
        make \
    && rm -rf /var/lib/apt/lists/*

# Set working directory to the repository root inside the container
WORKDIR /workspace

# Copy the repository into the image
COPY . /workspace

# Build the CUDA samples / targets present in the repository
RUN set -e; \
    for d in src/13-md/whole-code src/13-md/force-only src/13-md/cpp; do \
        if [ -d "$d" ]; then \
            echo "Building in $d"; \
            (cd "$d" && make); \
        fi; \
    done

# Default to an interactive shell, so users can run programs with --gpus
CMD ["/bin/bash"]