diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e0a5ed1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM rustlang/rust:nightly-bookworm-slim + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + build-essential \ + libclang-dev \ + libssl-dev \ + pkg-config + +COPY ./src ./src +COPY Cargo.toml Cargo.toml +COPY Cargo.lock Cargo.lock + +RUN cargo build --release + +FROM debian:bookworm-slim + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + openssl + +COPY --from=0 ./target/release/state-reconstruct /state-reconstruct +COPY IZkSync.json IZkSync.json +COPY InitialState.csv InitialState.csv + +CMD ["/state-reconstruct", "reconstruct", "l1", "--http-url", "https://eth.llamarpc.com"] diff --git a/README.md b/README.md index 9bbf172..83075f5 100644 --- a/README.md +++ b/README.md @@ -52,3 +52,15 @@ Options: -d, --db-path The path to the storage solution [env: ZK_SYNC_DB_PATH=] -h, --help Print help ``` + +## Container image + +To build the container image: +```fish +$ podman build -t state-reconstruction:latest . +``` + +To run it with `podman`: +```fish +$ podman run -it state-reconstruction:latest +``` \ No newline at end of file