From 6123975b9808eb6210921c2d7e55b6dcfe2751bf Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Thu, 1 Feb 2024 16:46:32 +0100 Subject: [PATCH] chore(docker): use zksync-build-base as a builder image (#988) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ ## Why ❔ ## Checklist - [ ] 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`. --- docker/build-base/Dockerfile | 2 +- docker/contract-verifier/Dockerfile | 14 +------------- docker/external-node/Dockerfile | 15 +-------------- docker/proof-fri-compressor/Dockerfile | 14 +------------- docker/prover-fri-gateway/Dockerfile | 14 +------------- docker/prover-fri/Dockerfile | 14 +------------- docker/server-v2/Dockerfile | 15 ++------------- docker/snapshots-creator/Dockerfile | 14 +------------- docker/witness-generator/Dockerfile | 14 +------------- docker/witness-vector-generator/Dockerfile | 14 +------------- 10 files changed, 11 insertions(+), 119 deletions(-) diff --git a/docker/build-base/Dockerfile b/docker/build-base/Dockerfile index 27a93b667faa..1fec4cca7e03 100644 --- a/docker/build-base/Dockerfile +++ b/docker/build-base/Dockerfile @@ -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 \ diff --git a/docker/contract-verifier/Dockerfile b/docker/contract-verifier/Dockerfile index 475a835e44cc..6941de6321f0 100644 --- a/docker/contract-verifier/Dockerfile +++ b/docker/contract-verifier/Dockerfile @@ -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 . . diff --git a/docker/external-node/Dockerfile b/docker/external-node/Dockerfile index c21f00daad2c..02dca4cd50c6 100644 --- a/docker/external-node/Dockerfile +++ b/docker/external-node/Dockerfile @@ -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 diff --git a/docker/proof-fri-compressor/Dockerfile b/docker/proof-fri-compressor/Dockerfile index e18c0c27f552..c6739dca8279 100644 --- a/docker/proof-fri-compressor/Dockerfile +++ b/docker/proof-fri-compressor/Dockerfile @@ -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 . . diff --git a/docker/prover-fri-gateway/Dockerfile b/docker/prover-fri-gateway/Dockerfile index 256621e8df75..f381a5902d7f 100644 --- a/docker/prover-fri-gateway/Dockerfile +++ b/docker/prover-fri-gateway/Dockerfile @@ -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 . . diff --git a/docker/prover-fri/Dockerfile b/docker/prover-fri/Dockerfile index 8244aea06b28..fd85801b7294 100644 --- a/docker/prover-fri/Dockerfile +++ b/docker/prover-fri/Dockerfile @@ -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 . . diff --git a/docker/server-v2/Dockerfile b/docker/server-v2/Dockerfile index a7d8fc7487fd..e5d378c3b6d8 100644 --- a/docker/server-v2/Dockerfile +++ b/docker/server-v2/Dockerfile @@ -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 diff --git a/docker/snapshots-creator/Dockerfile b/docker/snapshots-creator/Dockerfile index 897f28f87800..10eef06dfbbc 100644 --- a/docker/snapshots-creator/Dockerfile +++ b/docker/snapshots-creator/Dockerfile @@ -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 diff --git a/docker/witness-generator/Dockerfile b/docker/witness-generator/Dockerfile index f431339d3e96..42dee7ba5d0b 100644 --- a/docker/witness-generator/Dockerfile +++ b/docker/witness-generator/Dockerfile @@ -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 . . diff --git a/docker/witness-vector-generator/Dockerfile b/docker/witness-vector-generator/Dockerfile index 5861f3e51622..7d3c44f67fc9 100644 --- a/docker/witness-vector-generator/Dockerfile +++ b/docker/witness-vector-generator/Dockerfile @@ -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 . .