-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.verifier
More file actions
40 lines (34 loc) · 1.66 KB
/
Copy pathDockerfile.verifier
File metadata and controls
40 lines (34 loc) · 1.66 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
FROM rust:1-bookworm AS builder
WORKDIR /build
# Copy workspace root files
COPY Cargo.toml Cargo.lock ./
# Copy only the crates needed for verifier-api.
COPY common/ common/
COPY client/ client/
COPY verifier-api/ verifier-api/
# Create stub crates for workspace members that are excluded from context
# so Cargo can resolve the workspace without their source
RUN mkdir -p host/src enclave/src gateway-api/src compliance/src \
ephemeralml-doctor/src ephemeralml-smoke-test/src \
&& echo 'fn main() {}' > host/src/main.rs \
&& echo 'fn main() {}' > enclave/src/main.rs \
&& echo 'fn main() {}' > gateway-api/src/main.rs \
&& echo 'fn main() {}' > compliance/src/main.rs \
&& echo 'fn main() {}' > ephemeralml-doctor/src/main.rs \
&& echo 'fn main() {}' > ephemeralml-smoke-test/src/main.rs
# Copy stub Cargo.tomls for missing workspace members
# These just need [package] name and version to satisfy the workspace resolver
RUN for crate in host enclave gateway-api compliance ephemeralml-doctor ephemeralml-smoke-test; do \
if [ ! -f "$crate/Cargo.toml" ]; then \
echo "[package]" > "$crate/Cargo.toml" \
&& echo "name = \"ephemeral-ml-$crate\"" >> "$crate/Cargo.toml" \
&& echo "version = \"0.1.0\"" >> "$crate/Cargo.toml" \
&& echo "edition = \"2021\"" >> "$crate/Cargo.toml"; \
fi; \
done
RUN cargo build --release -p ephemeralml-verifier-api
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/target/release/ephemeralml-verifier /app/ephemeralml-verifier
EXPOSE 8080
ENTRYPOINT ["/app/ephemeralml-verifier"]