Skip to content

Commit 2391dc8

Browse files
Configure Docker image with proper proving keys (#1766)
Add proving key files to Docker image instead of using empty directory. Change run mode to RPC and update documentation for Docker usage.
1 parent 005b3e6 commit 2391dc8

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed

prover/server/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ COPY . .
1010
ENV CGO_ENABLED=0
1111
RUN go build -v -o /usr/local/bin/light-prover .
1212

13-
RUN mkdir -p /tmp/empty_proving_keys
14-
1513
FROM gcr.io/distroless/base-debian11:nonroot
1614

1715
COPY --from=builder /usr/local/bin/light-prover /usr/local/bin/light-prover
18-
COPY --chown=nonroot:nonroot --from=builder /tmp/empty_proving_keys /proving-keys/
16+
17+
WORKDIR /proving-keys
18+
19+
COPY --chown=nonroot:nonroot ./proving-keys/mainnet* /proving-keys/
20+
COPY --chown=nonroot:nonroot ./proving-keys/inclusion* /proving-keys/
21+
COPY --chown=nonroot:nonroot ./proving-keys/non-inclusion_* /proving-keys/
22+
COPY --chown=nonroot:nonroot ./proving-keys/combined_* /proving-keys/
23+
24+
WORKDIR /
1925

2026
ENTRYPOINT [ "light-prover" ]
21-
CMD [ "start", "--inclusion", "--non-inclusion", "--keys-dir", "/proving-keys/" ]
27+
CMD [ "start", "--run-mode", "rpc", "--keys-dir", "/proving-keys/" ]

prover/server/README.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,34 +102,48 @@ To run specific tests cd into respective folder (merkle-tree/prover) and `go tes
102102

103103
## Docker
104104

105+
The Docker image is configured to include only the necessary proving-key files:
106+
- Files with `mainnet*` prefix
107+
- Files with `inclusion*` prefix
108+
- Files with `non-inclusion_*` prefix
109+
- Files with `combined_*` prefix
110+
111+
### Building the Docker Image
112+
105113
```shell
114+
# First ensure you have the proving keys downloaded
115+
./scripts/download_keys.sh light
116+
117+
# Build the Docker image with the selected proving keys
118+
# Make sure to run this command from the prover/server directory
106119
docker build -t light-prover .
120+
```
107121

122+
### Running the Docker Image
123+
124+
```shell
108125
docker run -d \
109-
-v /path/to/proving-keys:/proving-keys/:ro \
110126
-p 3001:3001 \
111-
light-prover:latest \
112-
start \
113-
--run-mode forester-test \
114-
--keys-dir /proving-keys/
127+
light-prover:latest
115128
```
116129

117-
Or in docker compose
130+
### Docker Compose
118131

119132
```yaml
120133
light-prover:
121-
# Path to the repo root directory
122-
build: ./light-prover
123-
volumes:
124-
- /host/path/to/proving-keys:/proving-keys
134+
# Path to the prover/server directory
135+
build: ./prover/server
125136
ports:
126137
# Server
127138
- "3001:3001"
128139
# Metrics
129140
- "9998:9998"
141+
```
130142
131-
docker compose build
132-
docker compose up -d
143+
```shell
144+
# Build and run with Docker Compose
145+
docker compose build
146+
docker compose up -d
133147
```
134148

135149
## Formal Verification

0 commit comments

Comments
 (0)