Files
ere/docker/ziren/Dockerfile.compiler
2025-12-12 09:31:11 +08:00

40 lines
1.1 KiB
Docker

ARG BASE_ZKVM_IMAGE=ere-base-ziren:latest
ARG RUNTIME_IMAGE=ubuntu:24.04
FROM $BASE_ZKVM_IMAGE AS base_zkvm
FROM base_zkvm AS build_stage
COPY . /ere
WORKDIR /ere
RUN cargo build --release --package ere-compiler --bin ere-compiler --features ziren \
&& mkdir bin && mv target/release/ere-compiler bin/ere-compiler \
&& cargo clean && rm -rf $CARGO_HOME/registry/
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=base_zkvm /usr/local/cargo /usr/local/cargo
COPY --from=base_zkvm /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 Ziren SDK
COPY --from=base_zkvm /root/.zkm-toolchain /root/.zkm-toolchain
# Copy ere-compiler
COPY --from=build_stage /ere/bin/ere-compiler /ere/bin/ere-compiler
ENTRYPOINT ["/ere/bin/ere-compiler"]