Skip to content

Commit

Permalink
chore(docker): use zksync-build-base as a builder image (matter-labs#988
Browse files Browse the repository at this point in the history
)

## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
  • Loading branch information
montekki authored Feb 1, 2024
1 parent 00d7f98 commit 6123975
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 119 deletions.
2 changes: 1 addition & 1 deletion docker/build-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev && \
pkg-config build-essential libclang-dev linux-libc-dev liburing-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
Expand Down
14 changes: 1 addition & 13 deletions docker/contract-verifier/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# syntax=docker/dockerfile:experimental
FROM debian:bookworm-slim as builder

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-08-21 && \
rustup default nightly-2023-08-21
FROM matterlabs/zksync-build-base:latest as builder

WORKDIR /usr/src/zksync
COPY . .
Expand Down
15 changes: 1 addition & 14 deletions docker/external-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
# Will work locally only after prior contracts build

FROM debian:bookworm-slim as builder

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-08-21 && \
rustup default nightly-2023-08-21
FROM matterlabs/zksync-build-base:latest as builder

WORKDIR /usr/src/zksync
COPY . .

RUN cargo build --release
RUN cargo install sqlx-cli --version 0.7.3

FROM debian:bookworm-slim

Expand Down
14 changes: 1 addition & 13 deletions docker/proof-fri-compressor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# Will work locally only after prior universal setup key download

FROM debian:bookworm-slim as builder
FROM matterlabs/zksync-build-base:latest as builder

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-08-21 && \
rustup default nightly-2023-08-21

WORKDIR /usr/src/zksync
COPY . .

Expand Down
14 changes: 1 addition & 13 deletions docker/prover-fri-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
FROM debian:bookworm-slim as builder
FROM matterlabs/zksync-build-base:latest as builder

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-08-21 && \
rustup default nightly-2023-08-21

WORKDIR /usr/src/zksync
COPY . .

Expand Down
14 changes: 1 addition & 13 deletions docker/prover-fri/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
FROM debian:bookworm-slim as builder
FROM matterlabs/zksync-build-base:latest as builder

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-08-21 && \
rustup default nightly-2023-08-21

WORKDIR /usr/src/zksync
COPY . .

Expand Down
15 changes: 2 additions & 13 deletions docker/server-v2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# Will work locally only after prior contracts build
# syntax=docker/dockerfile:experimental
FROM debian:bookworm-slim as builder
FROM matterlabs/zksync-build-base:latest as builder

WORKDIR /usr/src/zksync
COPY . .

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev linux-libc-dev liburing-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-08-21 && \
rustup default nightly-2023-08-21
COPY . .

RUN cargo build --release --features=rocksdb/io-uring

Expand Down
14 changes: 1 addition & 13 deletions docker/snapshots-creator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# syntax=docker/dockerfile:experimental
FROM debian:bookworm-slim as builder
FROM matterlabs/zksync-build-base:latest as builder

WORKDIR /usr/src/zksync
COPY . .

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev linux-libc-dev liburing-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-08-21 && \
rustup default nightly-2023-08-21

RUN cargo build --release --bin snapshots_creator

FROM debian:bookworm-slim
Expand Down
14 changes: 1 addition & 13 deletions docker/witness-generator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
FROM debian:bookworm-slim as builder
FROM matterlabs/zksync-build-base:latest AS builder

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-08-21 && \
rustup default nightly-2023-08-21

WORKDIR /usr/src/zksync
COPY . .

Expand Down
14 changes: 1 addition & 13 deletions docker/witness-vector-generator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
FROM debian:bookworm-slim as builder
FROM matterlabs/zksync-build-base:latest as builder

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y curl clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev && \
rm -rf /var/lib/apt/lists/*

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-08-21 && \
rustup default nightly-2023-08-21

WORKDIR /usr/src/zksync
COPY . .

Expand Down

0 comments on commit 6123975

Please sign in to comment.