-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.gpu
More file actions
66 lines (54 loc) · 1.94 KB
/
Dockerfile.gpu
File metadata and controls
66 lines (54 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Use Ubuntu as base image
FROM nvidia/cuda:12.5.1-devel-ubuntu22.04
# Prevent timezone prompt during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install essential packages
RUN apt-get update && apt-get install -y \
curl \
git \
build-essential \
pkg-config \
libssl-dev \
clang \
cmake \
docker.io \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
ENV RUSTUP_PERMIT_COPY_RENAME=true
COPY rust-toolchain.toml /prooflab-rs/rust-toolchain.toml
# Install rust toolchain
RUN rustup toolchain install 1.85.0 && \
rustup default 1.85.0 && \
rustup component add rustfmt clippy
# Set shell to bash for all subsequent RUN commands
SHELL ["/bin/bash", "-c"]
# Create working directory
WORKDIR /prooflab-rs
# Copy project files
COPY install_prooflab_from_source.sh /prooflab-rs/install_prooflab_from_source.sh
COPY examples /prooflab-rs/examples
COPY Makefile /prooflab-rs/Makefile
COPY build.sh /prooflab-rs/build.sh
COPY crates /prooflab-rs/crates
COPY workspaces /prooflab-rs/workspaces
COPY Cargo.toml /prooflab-rs/Cargo.toml
COPY Cargo.lock /prooflab-rs/Cargo.lock
# Install prooflab-rs and its dependencies
RUN --mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/.cargo/git \
chmod +x /prooflab-rs/install_prooflab_from_source.sh && \
bash /prooflab-rs/install_prooflab_from_source.sh && \
echo 'source ~/.bashrc' >> ~/.bash_profile && \
echo 'source ~/.bashrc' >> ~/.profile
# Set environment variables
ENV PROOFLAB_DIR=/root/.prooflab
ENV PROOFLAB_BIN_DIR=/root/.prooflab/bin
ENV PATH="${PATH}:${PROOFLAB_BIN_DIR}:/root/.risc0/bin:/root/.sp1/bin"
# Create entrypoint script properly
RUN printf '#!/bin/bash\nsource ~/.bashrc\nexec "$@"\n' > /entrypoint.sh && \
cat /entrypoint.sh && \
chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]