forked from risc0/zeth
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
44 lines (37 loc) · 1.31 KB
/
Dockerfile
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
FROM rust:1.75.0 as builder
ENV DEBIAN_FRONTEND=noninteractive
ARG BUILD_FLAGS=""
WORKDIR /opt/raiko
COPY . .
RUN apt-get update && \
apt-get install -y \
cmake \
libclang-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN cargo build --release ${BUILD_FLAGS}
FROM gramineproject/gramine:1.6-jammy as runtime
WORKDIR /opt/raiko
RUN apt-get update && \
apt-get install -y sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p \
./bin \
./guests/sgx \
./secrets \
/etc/opt/raiko \
/tmp/sgx \
/var/log/raiko
COPY --from=builder /opt/raiko/target/release/raiko-guest ./guests/sgx/
COPY --from=builder /opt/raiko/raiko-guest/config/raiko-guest.manifest.template ./guests/sgx/
COPY --from=builder /opt/raiko/target/release/raiko-host ./bin
COPY --from=builder /opt/raiko/raiko-host/config/config.toml /etc/opt/raiko/
COPY --from=builder /opt/raiko/docker/entrypoint.sh ./bin
COPY ./sgx-ra/src/*.so /usr/lib/
RUN cd ./guests/sgx && \
gramine-manifest -Dlog_level=error -Darch_libdir=/lib/x86_64-linux-gnu/ raiko-guest.manifest.template raiko-guest.manifest && \
gramine-sgx-gen-private-key && \
gramine-sgx-sign --manifest raiko-guest.manifest --output raiko-guest.manifest.sgx && \
cd -
ENTRYPOINT [ "/opt/raiko/bin/entrypoint.sh" ]