Skip to content

Commit

Permalink
Fix and simplify hive dockerfile (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
ercecan authored May 3, 2024
1 parent 99ac329 commit 0ff95c9
Showing 1 changed file with 8 additions and 32 deletions.
40 changes: 8 additions & 32 deletions hive/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 0ff95c9

Please sign in to comment.