-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
101 lines (80 loc) · 3.72 KB
/
Dockerfile
File metadata and controls
101 lines (80 loc) · 3.72 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Base stage: Install Rust and dependencies
FROM ubuntu:24.04 AS rust-base
WORKDIR /usr/src/app
# Install required dependencies
RUN apt-get update && apt-get install -y \
curl \
clang \
build-essential \
git \
pkg-config \
libssl-dev \
protobuf-compiler \
&& 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
RUN rustup install stable && rustup default stable
# Install Go
RUN apt update
RUN apt install -y golang-go
# Install SP1
RUN curl -L https://sp1.succinct.xyz | bash && \
~/.sp1/bin/sp1up && \
~/.sp1/bin/cargo-prove prove --version
###############################################################################
# #
# Server Builder #
# #
###############################################################################
FROM rust-base AS server-builder
# Copy the entire workspace
COPY . .
# Build the proposer binary
RUN cargo build --release --bin sp1-tee-private-server --locked
###############################################################################
# #
# Fulfiller Builder #
# #
###############################################################################
FROM rust-base AS fulfiller-builder
# Copy the entire workspace
COPY . .
# Build the proposer binary
RUN cargo build --release --bin sp1-tee-private-fulfiller --locked
###############################################################################
# #
# Base Runtime #
# #
###############################################################################
FROM ubuntu:24.04 as runtime
WORKDIR /app
# Install only necessary runtime dependencies
RUN apt-get update && apt-get install -y \
curl \
libssl-dev \
&& 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
RUN rustup install stable && rustup default stable
###############################################################################
# #
# Server Runtime #
# #
###############################################################################
FROM runtime as server
# Copy the built proposer binary
COPY --from=server-builder /usr/src/app/target/release/sp1-tee-private-server /usr/local/bin/
# Set the command
CMD ["sp1-tee-private-server"]
###############################################################################
# #
# Fulfiller Runtime #
# #
###############################################################################
FROM runtime as fulfiller
# Copy the built proposer binary
COPY --from=fulfiller-builder /usr/src/app/target/release/sp1-tee-private-fulfiller /usr/local/bin/
# Set the command
CMD ["sp1-tee-private-fulfiller"]