diff --git a/CHANGELOG.md b/CHANGELOG.md index 0684e53ba..18bd5cbe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Next release +- fix: docker file fixes for devnet - fix(block-production): fix bouncer calculation and declared classes - fix: Fix pending block sync and add real FGW tests - test: tests added for verify and apply task in l2 sync diff --git a/Dockerfile b/Dockerfile index b7f53af18..1a2ba9ab2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,46 @@ # Stage 1: Build the application -FROM rust:1.78 as builder +FROM rust:1.78 AS builder # Install build dependencies -RUN apt-get -y update && \ +RUN apt-get -y update && \ apt-get install -y clang && \ - apt-get autoremove -y; \ - apt-get clean; \ + apt-get autoremove -y; \ + apt-get clean; \ rm -rf /var/lib/apt/lists/* # Set the working directory WORKDIR /usr/src/madara/ -# Copy the source code into the container +# Copy the source code COPY Cargo.toml Cargo.lock ./ COPY crates crates +COPY cairo cairo +COPY cairo_0 cairo_0 + +# Installing scarb, new since devnet integration +# Installation steps are taken from the scarb build script +# https://github.com/software-mansion/scarb/blob/main/install.sh +ENV SCARB_VERSION="v2.8.2" +ENV SCARB_REPO="https://github.com/software-mansion/scarb/releases/download" +ENV PLATFORM="x86_64-unknown-linux-gnu" +ENV SCARB_TARGET="/usr/src/scarb.tar.gz" + +RUN curl -fLS -o $SCARB_TARGET \ + $SCARB_REPO/$SCARB_VERSION/scarb-$SCARB_VERSION-$PLATFORM.tar.gz && \ + tar -xz -C /usr/src/ --strip-components=1 -f $SCARB_TARGET && \ + mv /usr/src/bin/scarb /bin # Build the application in release mode RUN cargo build --release # Stage 2: Create the final runtime image -FROM debian:bookworm +FROM debian:bookworm-slim # Install runtime dependencies -RUN apt-get -y update && \ - apt-get install -y openssl ca-certificates tini &&\ - apt-get autoremove -y; \ - apt-get clean; \ +RUN apt-get -y update && \ + apt-get install -y openssl ca-certificates && \ + apt-get autoremove -y; \ + apt-get clean; \ rm -rf /var/lib/apt/lists/* # Set the working directory @@ -34,5 +49,9 @@ WORKDIR /usr/local/bin # Copy the compiled binary from the builder stage COPY --from=builder /usr/src/madara/target/release/madara . +# chain presets to be monted at startup +VOLUME crates/primitives/chain_config/presets +VOLUME crates/primitives/chain_config/resources + # Set the entrypoint -CMD ["./madara"] \ No newline at end of file +ENTRYPOINT ["./madara"] diff --git a/README.md b/README.md index b50dece50..cbbbbde65 100644 --- a/README.md +++ b/README.md @@ -84,14 +84,17 @@ Madara is a powerfull Starknet hybrid client written in Rust. To run Madara with Docker, use the following command: ```sh -docker run -d \ - --name madara \ - -p 9944:9944 \ +docker run -d \ + --name madara \ + -p 9944:9944 \ -v /var/lib/madara:/var/lib/madara \ - madara:latest \ - --base-path ../madara-db \ - --network main \ - --l1-endpoint \ + madara:latest \ + --base-path ./madara-db \ + --network main \ + --rpc-external \ + --rpc-cors all \ + --preset mainnet \ + --l1-endpoint ``` Check the logs of the running Madara service: