1+ # Use NVIDIA CUDA 13.0.2 development image with Ubuntu 22.04 as the base
2+ FROM nvidia/cuda:13.0.2-devel-ubuntu22.04
3+ # Docker and Docker Compose arguments
4+
5+ # Use 1001 and 121 for compatibility with GitHub-hosted runners
6+ ARG RUNNER_UID=1000
7+ ARG DOCKER_GID=1001
8+
9+ ENV DEBIAN_FRONTEND=noninteractive
10+
11+ # Install necessary packages
12+ RUN apt-get update -y \
13+ && apt-get install -y software-properties-common \
14+ && add-apt-repository -y ppa:git-core/ppa \
15+ && apt-get update -y \
16+ && apt-get install -y --no-install-recommends \
17+ build-essential \
18+ curl \
19+ ca-certificates \
20+ dnsutils \
21+ ftp \
22+ git \
23+ uuid-dev \
24+ iproute2 \
25+ iputils-ping \
26+ jq \
27+ libunwind8 \
28+ locales \
29+ netcat \
30+ openssh-client \
31+ parallel \
32+ python3-pip \
33+ rsync \
34+ shellcheck \
35+ sudo \
36+ telnet \
37+ time \
38+ tzdata \
39+ unzip \
40+ upx \
41+ wget \
42+ lsb-release \
43+ openssl \
44+ libssl-dev \
45+ manpages-dev \
46+ zip \
47+ zstd \
48+ pkg-config \
49+ ccache \
50+ gcc \
51+ g++ \
52+ && ln -sf /usr/bin/python3 /usr/bin/python \
53+ && ln -sf /usr/bin/pip3 /usr/bin/pip \
54+ && rm -rf /var/lib/apt/lists/*
55+
56+ # Add Kitware's APT repository for CMake
57+ RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
58+ apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
59+ apt-get update && \
60+ apt-get install -y cmake
61+
62+ # Download latest git-lfs version
63+ RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
64+ apt-get install -y --no-install-recommends git-lfs
65+
66+ RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \
67+ && groupadd docker --gid $DOCKER_GID \
68+ && usermod -aG sudo runner \
69+ && usermod -aG docker runner \
70+ && echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
71+ && echo "Defaults env_keep += \" DEBIAN_FRONTEND\" " >> /etc/sudoers
72+
73+ ENV HOME=/home/runner
74+
75+ ARG RUNNER_VERSION=2.328.0
76+
77+ # cd into the user directory, download and unzip the github actions runner
78+ RUN cd /home/runner && mkdir actions-runner && cd actions-runner \
79+ && curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \
80+ && tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz
81+
82+ RUN chown -R runner:runner /home/runner && /home/runner/actions-runner/bin/installdependencies.sh
83+
84+ ADD --chown=runner:runner ./start.sh /home/runner/start.sh
85+
86+ RUN chmod 755 /home/runner/start.sh
87+
88+ # Add /usr/local/cuda-11.7/compat to LD_LIBRARY_PATH
89+ ENV LD_LIBRARY_PATH=/usr/local/cuda-13.0/compat${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
90+
91+ ENTRYPOINT ["/bin/bash" , "/home/runner/start.sh" ]
92+
93+ USER runner
0 commit comments