Skip to content

Commit

Permalink
Add Dockerfile (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuommaki authored Oct 24, 2023
1 parent fa4a69c commit a2356ec
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,15 @@ Options:
-d, --db-path <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
```

0 comments on commit a2356ec

Please sign in to comment.