-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update the makefile and dockerfile
- Loading branch information
Showing
5 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Build libzkp dependency | ||
FROM scrolltech/go-rust-builder:go-1.19-rust-nightly-2022-12-10 as chef | ||
WORKDIR app | ||
|
||
FROM chef as planner | ||
COPY ./common/libzkp/impl/ . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
FROM chef as zkp-builder | ||
COPY ./common/libzkp/impl/rust-toolchain ./ | ||
COPY --from=planner /app/recipe.json recipe.json | ||
RUN cargo chef cook --release --recipe-path recipe.json | ||
|
||
COPY ./common/libzkp/impl . | ||
RUN cargo build --release | ||
RUN find ./ | grep libzktrie.so | xargs -I{} cp {} /app/target/release/ | ||
|
||
|
||
# Download Go dependencies | ||
FROM scrolltech/go-rust-builder:go-1.19-rust-nightly-2022-12-10 as base | ||
WORKDIR /src | ||
COPY go.work* ./ | ||
COPY ./rollup/go.* ./rollup/ | ||
COPY ./common/go.* ./common/ | ||
COPY ./coordinator/go.* ./coordinator/ | ||
COPY ./database/go.* ./database/ | ||
COPY ./prover/go.* ./prover/ | ||
COPY ./tests/integration-test/go.* ./tests/integration-test/ | ||
COPY ./bridge-history-api/go.* ./bridge-history-api/ | ||
RUN go mod download -x | ||
|
||
|
||
# Build coordinator | ||
FROM base as builder | ||
COPY . . | ||
RUN cp -r ./common/libzkp/interface ./coordinator/internal/logic/verifier/lib | ||
COPY --from=zkp-builder /app/target/release/libzkp.so ./coordinator/internal/logic/verifier/lib/ | ||
COPY --from=zkp-builder /app/target/release/libzktrie.so ./coordinator/internal/logic/verifier/lib/ | ||
RUN cd ./coordinator && make coordinator_cron_skip_libzkp && mv ./build/bin/coordinator_cron /bin/coordinator_cron && mv internal/logic/verifier/lib /bin/ | ||
|
||
# Pull coordinator into a second stage deploy alpine container | ||
FROM ubuntu:20.04 | ||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/src/coordinator/internal/logic/verifier/lib | ||
# ENV CHAIN_ID=534353 | ||
RUN mkdir -p /src/coordinator/internal/logic/verifier/lib | ||
COPY --from=builder /bin/lib /src/coordinator/internal/logic/verifier/lib | ||
COPY --from=builder /bin/coordinator_cron /bin/ | ||
RUN /bin/coordinator_cron --version | ||
|
||
ENTRYPOINT ["/bin/coordinator_cron"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
assets/ | ||
contracts/ | ||
docs/ | ||
l2geth/ | ||
rpc-gateway/ | ||
*target/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters