mirror of
https://github.com/eth-act/ere.git
synced 2026-02-19 11:54:42 -05:00
44 lines
1.2 KiB
Docker
44 lines
1.2 KiB
Docker
ARG BASE_ZKVM_IMAGE=ere-base-risc0:latest
|
|
ARG BASE_ZKVM_CUDA_IMAGE=ere-base-risc0:latest-cuda
|
|
ARG RUNTIME_IMAGE=ubuntu:24.04
|
|
ARG RUNTIME_CUDA_IMAGE=nvidia/cuda:12.9.1-runtime-ubuntu24.04
|
|
|
|
# Whether to enable CUDA feature or not.
|
|
ARG CUDA
|
|
|
|
FROM $BASE_ZKVM_IMAGE AS base
|
|
FROM $BASE_ZKVM_CUDA_IMAGE AS base_cuda
|
|
FROM base${CUDA:+_cuda} AS build_stage
|
|
|
|
COPY . /ere
|
|
|
|
WORKDIR /ere
|
|
|
|
ARG CUDA
|
|
ARG RUSTFLAGS
|
|
|
|
RUN cargo build --release --package ere-server --bin ere-server --features risc0${CUDA:+,cuda} \
|
|
&& mkdir bin && mv target/release/ere-server bin/ere-server \
|
|
&& cargo clean && rm -rf $CARGO_HOME/registry/src $CARGO_HOME/registry/cache
|
|
|
|
FROM $RUNTIME_IMAGE AS runtime
|
|
FROM $RUNTIME_CUDA_IMAGE AS runtime_cuda
|
|
FROM runtime${CUDA:+_cuda} AS runtime_stage
|
|
|
|
# Copy symlinks of r0vm(-cuda)
|
|
COPY --from=build_stage /usr/local/cargo/bin/r0vm* /usr/local/cargo/bin/
|
|
|
|
# Add symlinks of r0vm(-cuda) to path
|
|
ENV PATH=/usr/local/cargo/bin:$PATH
|
|
|
|
# Copy Risc0 SDK
|
|
COPY --from=build_stage /root/.risc0/extensions /root/.risc0/extensions
|
|
|
|
# Add Docker CLI (only needed for Groth16 proof kind)
|
|
COPY --from=docker:cli /usr/local/bin/docker /usr/local/bin/docker
|
|
|
|
# Copy ere-server
|
|
COPY --from=build_stage /ere/bin/ere-server /ere/bin/ere-server
|
|
|
|
ENTRYPOINT ["/ere/bin/ere-server"]
|