Files
ere/docker/openvm/Dockerfile.compiler
2025-10-09 21:47:10 +08:00

35 lines
1011 B
Docker

ARG BASE_ZKVM_IMAGE=ere-base-openvm:latest
ARG RUNTIME_IMAGE=ubuntu:24.04
FROM $BASE_ZKVM_IMAGE AS build_stage
COPY . /ere
WORKDIR /ere
RUN cargo build --release --package ere-compiler --bin ere-compiler --features openvm \
&& mkdir bin && mv target/release/ere-compiler bin/ere-compiler \
&& cargo clean && rm -rf $CARGO_HOME/registry/src $CARGO_HOME/registry/cache
FROM $RUNTIME_IMAGE AS runtime_stage
# Install common dependencies and build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy Rust
COPY --from=build_stage /usr/local/cargo /usr/local/cargo
COPY --from=build_stage /usr/local/rustup /usr/local/rustup
# Add Rust to path
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
# Copy ere-compiler
COPY --from=build_stage /ere/bin/ere-compiler /ere/bin/ere-compiler
ENTRYPOINT ["/ere/bin/ere-compiler"]