forked from matter-labs/zksync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove slow cached compiles of rust in docker
- Loading branch information
Showing
6 changed files
with
61 additions
and
43 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
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
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
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 |
---|---|---|
@@ -1,5 +1,16 @@ | ||
FROM alpine | ||
# syntax=docker/dockerfile:experimental | ||
FROM rust:1.45 as builder | ||
RUN --mount=type=cache,target=/usr/local/cargo/registry \ | ||
cargo install sccache | ||
WORKDIR /usr/src/zksync | ||
COPY . . | ||
RUN --mount=type=cache,target=/usr/local/cargo/registry \ | ||
--mount=type=cache,target=/root/.cache/sccache \ | ||
RUSTC_WRAPPER=/usr/local/cargo/bin/sccache \ | ||
cargo build --release | ||
|
||
FROM debian:buster-slim | ||
EXPOSE 9876 | ||
ENV RUST_LOG info | ||
COPY target/x86_64-unknown-linux-musl/release/dev-ticker-server /bin/ | ||
COPY --from=builder /usr/src/zksync/target/release/dev-ticker-server /bin/ | ||
ENTRYPOINT ["dev-ticker-server"] |
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
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 |
---|---|---|
@@ -1,8 +1,20 @@ | ||
FROM alpine | ||
# syntax=docker/dockerfile:experimental | ||
FROM rust:1.45 as builder | ||
RUN --mount=type=cache,target=/usr/local/cargo/registry \ | ||
cargo install sccache | ||
WORKDIR /usr/src/zksync | ||
COPY . . | ||
RUN --mount=type=cache,target=/usr/local/cargo/registry \ | ||
--mount=type=cache,target=/root/.cache/sccache \ | ||
RUSTC_WRAPPER=/usr/local/cargo/bin/sccache \ | ||
cargo build --release | ||
|
||
FROM debian:buster-slim | ||
RUN apt-get update && apt-get install -y libpq5 && rm -rf /var/lib/apt/lists/* | ||
EXPOSE 3000 | ||
EXPOSE 3031 | ||
EXPOSE 3030 | ||
COPY target/x86_64-unknown-linux-musl/release/server / | ||
COPY --from=builder /usr/src/zksync/target/release/server /usr/bin | ||
COPY contracts/build/ /contracts/build/ | ||
COPY bin/kube-is-leader.sh /bin/ | ||
ENTRYPOINT ["/server"] | ||
ENTRYPOINT ["server"] |