From 0ff95c9df14f1e1dda0d04aa0f07698d6af43aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erce=20Can=20Bekt=C3=BCre?= <47954181+ercecan@users.noreply.github.com> Date: Fri, 3 May 2024 15:41:44 +0300 Subject: [PATCH] Fix and simplify hive dockerfile (#484) --- hive/Dockerfile | 40 ++++++++-------------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/hive/Dockerfile b/hive/Dockerfile index a168c28a8..ce60f4b86 100644 --- a/hive/Dockerfile +++ b/hive/Dockerfile @@ -1,45 +1,21 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef +FROM rust:latest AS runtime WORKDIR /app -# Builds a cargo-chef plan -FROM chef AS planner -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -COPY --from=planner /app/recipe.json recipe.json # Install system dependencies -RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config && apt-get install protobuf-compiler -y +RUN apt-get update && apt-get -y upgrade && \ + apt-get install -y libclang-dev pkg-config && \ + apt-get install protobuf-compiler -y && apt-get install -y curl && \ + apt-get install cmake -y -# Build dependencies - this is the caching Docker layer! -RUN cargo chef cook --release --recipe-path recipe.json COPY . . -# Install risczero -RUN cargo install cargo-binstall && cargo binstall cargo-risczero -y && cargo risczero install --version v2024-04-22.0 - # Build the project -RUN cargo build --release --bin citrea +RUN SKIP_GUEST_BUILD=1 cargo build --release --bin citrea -# We need cargo to run the binary because of some path finding dependencies -FROM rust:latest AS runtime -WORKDIR /app - -# Install curl -RUN apt-get update && \ - apt-get install -y curl - -# Copying the directory except the target directory -COPY --from=builder /app /app - -# Copy the binary from the builder stage -COPY --from=builder /app/target/release/citrea /app/bin/citrea - -RUN cargo EXPOSE 8545 -WORKDIR /app/bin/citrea -ENTRYPOINT ["sh", "-c", "./publish_da_block.sh & ./citrea --genesis-paths ../../hive/genesis --rollup-config-path configs/mock-dockerized/rollup_config.toml --sequencer-config-path configs/mock-dockerized/sequencer_config.toml"] + +ENTRYPOINT ["sh", "-c", "./bin/citrea/publish_da_block.sh & ./target/release/citrea --genesis-paths ./hive/genesis --rollup-config-path ./bin/citrea/configs/mock-dockerized/rollup_config.toml --sequencer-config-path ./bin/citrea/configs/mock-dockerized/sequencer_config.toml"]