Files
foxhunt/infra/docker/Dockerfile.ci-builder

51 lines
1.8 KiB
Docker

# Pre-baked CI builder image for Foxhunt
# Contains: CUDA 12.4, Rust 1.89, protoc, sccache, git, OpenSSL, lld, make
# Build: docker build -f infra/docker/Dockerfile.ci-builder -t foxhunt-ci-builder .
# Push: docker tag foxhunt-ci-builder git.fxhnt.ai:5050/root/foxhunt/ci-builder:latest
# docker push git.fxhnt.ai:5050/root/foxhunt/ci-builder:latest
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
ca-certificates \
pkg-config \
libssl-dev \
lld \
clang \
make \
perl \
build-essential \
libfontconfig1-dev \
unzip \
&& rm -rf /var/lib/apt/lists/*
# protoc 28.3 (proto3 optional support, matches local dev)
RUN curl -fsSL https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip -o /tmp/protoc.zip \
&& unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*' \
&& rm /tmp/protoc.zip \
&& chmod +x /usr/local/bin/protoc
# Install Rust 1.89 stable
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.89.0
ENV PATH="/root/.cargo/bin:${PATH}"
# sccache for S3-backed build caching
RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz \
| tar xz -C /usr/local/bin --strip-components=1 sccache-v0.10.0-x86_64-unknown-linux-musl/sccache \
&& chmod +x /usr/local/bin/sccache
# clippy pre-installed
RUN rustup component add clippy
# CUDA env
ENV CUDA_HOME=/usr/local/cuda
ENV PATH="${CUDA_HOME}/bin:${PATH}"
ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
# Verify
RUN rustc --version && cargo --version && git --version && protoc --version && sccache --version && make --version && nvcc --version