diff --git a/barretenberg/acir_tests/Dockerfile.bb b/barretenberg/acir_tests/Dockerfile.bb index e0267b01345..f7123707612 100644 --- a/barretenberg/acir_tests/Dockerfile.bb +++ b/barretenberg/acir_tests/Dockerfile.bb @@ -1,8 +1,8 @@ FROM aztecprotocol/barretenberg-x86_64-linux-clang-assert FROM aztecprotocol/noir-compile-acir-tests as noir-acir-tests -FROM node:18.19.0-alpine -RUN apk update && apk add git bash curl jq coreutils +FROM node:18.19.0 +RUN apt update && apt install git bash curl jq coreutils -y COPY --from=0 /usr/src/barretenberg/cpp/build /usr/src/barretenberg/cpp/build COPY --from=noir-acir-tests /usr/src/noir/noir-repo/test_programs /usr/src/noir/noir-repo/test_programs WORKDIR /usr/src/barretenberg/acir_tests diff --git a/barretenberg/acir_tests/Dockerfile.bb.sol b/barretenberg/acir_tests/Dockerfile.bb.sol index 16683d736db..2f89581c185 100644 --- a/barretenberg/acir_tests/Dockerfile.bb.sol +++ b/barretenberg/acir_tests/Dockerfile.bb.sol @@ -2,12 +2,16 @@ FROM aztecprotocol/barretenberg-x86_64-linux-clang-assert FROM aztecprotocol/barretenberg-x86_64-linux-clang-sol FROM aztecprotocol/noir-compile-acir-tests as noir-acir-tests -FROM node:18.19.0-alpine -RUN apk update && apk add git bash curl jq +FROM node:18.19.0 +RUN apt update && apt install git bash curl jq -y COPY --from=0 /usr/src/barretenberg/cpp/build /usr/src/barretenberg/cpp/build COPY --from=1 /usr/src/barretenberg/sol/src/ultra/BaseUltraVerifier.sol /usr/src/barretenberg/sol/src/ultra/BaseUltraVerifier.sol COPY --from=noir-acir-tests /usr/src/noir/noir-repo/test_programs /usr/src/noir/noir-repo/test_programs -COPY --from=ghcr.io/foundry-rs/foundry:latest /usr/local/bin/anvil /usr/local/bin/anvil + +RUN curl -L https://foundry.paradigm.xyz | bash +ENV PATH="${PATH}:/root/.foundry/bin" +RUN foundryup + WORKDIR /usr/src/barretenberg/acir_tests COPY . . # Run the relevant acir tests through a solidity verifier. diff --git a/barretenberg/cpp/dockerfiles/Dockerfile.bench b/barretenberg/cpp/dockerfiles/Dockerfile.bench index 42226685814..94d84f1338b 100644 --- a/barretenberg/cpp/dockerfiles/Dockerfile.bench +++ b/barretenberg/cpp/dockerfiles/Dockerfile.bench @@ -1,4 +1,4 @@ FROM aztecprotocol/barretenberg-x86_64-linux-clang WORKDIR /usr/src/barretenberg/cpp -RUN apk update && apk add curl libstdc++ jq +RUN apt update && apt install curl libstdc++6 jq -y RUN ./scripts/ci/ultra_honk_bench.sh diff --git a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang index fe984e74e35..568f0fcd9e4 100644 --- a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang +++ b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang @@ -1,23 +1,32 @@ -FROM alpine:3.18 AS builder -RUN apk update \ - && apk upgrade \ - && apk add --no-cache \ - build-base \ - clang16 \ - cmake \ - ninja \ - git \ - curl \ - perl +FROM ubuntu:lunar as builder + +RUN apt update && apt install -y \ + build-essential \ + curl \ + git \ + cmake \ + lsb-release \ + wget \ + software-properties-common \ + gnupg \ + ninja-build \ + npm \ + libssl-dev \ + jq \ + bash \ + libstdc++6 + +RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 + WORKDIR /usr/src/barretenberg/cpp COPY . . # Build bb binary and targets needed for benchmarking. # Everything else is built as part linux-clang-assert. # Benchmark targets want to run without asserts, so get built alongside bb. -RUN cmake --preset default -RUN cmake --build --preset default --target ultra_honk_rounds_bench --target bb --target grumpkin_srs_gen +RUN cmake --preset clang16 +RUN cmake --build --preset clang16 --target ultra_honk_rounds_bench --target bb --target grumpkin_srs_gen -FROM alpine:3.18 +FROM ubuntu:lunar WORKDIR /usr/src/barretenberg/cpp COPY . . COPY --from=builder /usr/src/barretenberg/cpp/scripts/ci /usr/src/barretenberg/cpp/scripts/ci diff --git a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert index d487335b597..a958ead8b83 100644 --- a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert +++ b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert @@ -1,24 +1,31 @@ -# We have to stay on 3.17 for now, to get clang-format 15, as code is not yet formatted to 16. -FROM alpine:3.17 AS builder -RUN apk update \ - && apk upgrade \ - && apk add --no-cache \ - build-base \ - clang15 \ - cmake \ - ninja \ - git \ - curl \ - perl \ - clang-extra-tools \ - bash +FROM ubuntu:lunar as builder + +RUN apt update && apt install -y \ + build-essential \ + curl \ + git \ + cmake \ + lsb-release \ + wget \ + software-properties-common \ + gnupg \ + ninja-build \ + npm \ + libssl-dev \ + jq \ + bash \ + libstdc++6 \ + clang-format + +RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 + WORKDIR /usr/src/barretenberg/cpp COPY . . # Build everything to ensure everything builds. All tests will be run from the result of this build. -RUN ./format.sh check && cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert -DCI=ON && cmake --build --preset default +RUN ./format.sh check && cmake --preset clang16 -DCMAKE_BUILD_TYPE=RelWithAssert -DCI=ON && cmake --build --preset clang16 RUN srs_db/download_grumpkin.sh -FROM alpine:3.17 -RUN apk update && apk add curl libstdc++ +FROM ubuntu:lunar +RUN apt update && apt install curl libstdc++6 -y COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db -COPY --from=builder /usr/src/barretenberg/cpp/build/bin /usr/src/barretenberg/cpp/build/bin \ No newline at end of file +COPY --from=builder /usr/src/barretenberg/cpp/build/bin /usr/src/barretenberg/cpp/build/bin diff --git a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-benchmarks b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-benchmarks index 00d896c6342..b2bbebeb48a 100644 --- a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-benchmarks +++ b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-benchmarks @@ -1,23 +1,29 @@ -FROM alpine:3.18 AS builder -RUN apk update \ - && apk upgrade \ - && apk add --no-cache \ - build-base \ - clang16 \ - openmp-dev \ - cmake \ - ninja \ - git \ - curl \ - perl +FROM ubuntu:lunar as builder -WORKDIR /usr/src/barretenberg/cpp +RUN apt update && apt install -y \ + build-essential \ + curl \ + git \ + cmake \ + lsb-release \ + wget \ + software-properties-common \ + gnupg \ + ninja-build \ + npm \ + libssl-dev \ + jq \ + bash \ + libstdc++6 + +RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 +WORKDIR /usr/src/barretenberg/cpp COPY . . # Build everything to ensure everything builds. All tests will be run from the result of this build. -RUN cmake --preset default && cmake --build --preset default --target external_bench +RUN cmake --preset clang16 && cmake --build --preset clang16 --target external_bench -FROM alpine:3.18 -RUN apk update && apk add curl openmp +FROM ubuntu:lunar +RUN apt update && apt install curl libomp-dev -y COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db -COPY --from=builder /usr/src/barretenberg/cpp/build/bin/*_bench /usr/src/barretenberg/cpp/build/bin/ \ No newline at end of file +COPY --from=builder /usr/src/barretenberg/cpp/build/bin/*_bench /usr/src/barretenberg/cpp/build/bin/ diff --git a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-fuzzing b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-fuzzing index f9dd7717b23..cc66d7958a0 100644 --- a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-fuzzing +++ b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-fuzzing @@ -1,23 +1,28 @@ -FROM alpine:3.18 AS builder -RUN apk update && \ - apk upgrade && \ - apk add --no-cache \ - build-base \ - clang16 \ - compiler-rt \ - openmp-dev \ - cmake \ - ninja \ - git \ - curl \ - perl +FROM ubuntu:lunar as builder -WORKDIR /usr/src/barretenberg/cpp +RUN apt update && apt install -y \ + build-essential \ + curl \ + git \ + cmake \ + lsb-release \ + wget \ + software-properties-common \ + gnupg \ + ninja-build \ + npm \ + libssl-dev \ + jq \ + bash \ + libstdc++6 + +RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 +WORKDIR /usr/src/barretenberg/cpp COPY . . -# Build the entire project, as we want to check everything builds under clang +# Build the entire project, as we want to check everything builds under clang-fuzzing with clang-16. RUN cmake --preset fuzzing && cmake --build --preset fuzzing -FROM alpine:3.18 -RUN apk update && apk add openmp +FROM ubuntu:lunar +RUN apt update && apt install libomp-dev -y COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db diff --git a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-gcc b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-gcc index 5bcdd5009be..3532d222f34 100644 --- a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-gcc +++ b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-gcc @@ -1,17 +1,28 @@ -FROM alpine:3.18 AS builder -RUN apk update \ - && apk upgrade \ - && apk add --no-cache \ - build-base \ - cmake \ - ninja \ - git \ - curl +FROM ubuntu:lunar as builder + +RUN apt update && apt install -y \ + build-essential \ + curl \ + git \ + cmake \ + lsb-release \ + wget \ + software-properties-common \ + gnupg \ + ninja-build \ + npm \ + libssl-dev \ + jq \ + bash \ + libstdc++6 + +RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 + WORKDIR /usr/src/barretenberg/cpp COPY . . # Build the entire project, as we want to check everything builds under gcc. RUN cmake --preset gcc -DCI=ON && cmake --build --preset gcc -FROM alpine:3.18 -RUN apk update && apk add libstdc++ +FROM ubuntu:lunar +RUN apt update && apt install libstdc++6 -y COPY --from=builder /usr/src/barretenberg/cpp/build-gcc/bin/bb /usr/src/barretenberg/cpp/build/bin/bb diff --git a/barretenberg/sol/Dockerfile b/barretenberg/sol/Dockerfile index df99298fb85..fc57077ff89 100644 --- a/barretenberg/sol/Dockerfile +++ b/barretenberg/sol/Dockerfile @@ -1,15 +1,22 @@ -FROM alpine:3.18 -RUN apk update \ - && apk upgrade \ - && apk add --no-cache \ - build-base \ - clang16 \ - openmp-dev \ - cmake \ - ninja \ - git \ - curl \ - perl +FROM ubuntu:lunar as builder + +RUN apt update && apt install -y \ + build-essential \ + curl \ + git \ + cmake \ + lsb-release \ + wget \ + software-properties-common \ + gnupg \ + ninja-build \ + npm \ + libssl-dev \ + jq \ + bash \ + libstdc++6 + +RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 WORKDIR /usr/src/barretenberg/cpp @@ -17,20 +24,27 @@ COPY ./cpp . # Build everything to ensure everything builds. All tests will be run from the result of this build. RUN cmake --preset clang16 && cmake --build --preset clang16 --target solidity_key_gen solidity_proof_gen -FROM docker.io/frolvlad/alpine-glibc:alpine-3.17_glibc-2.34 as builder -RUN apk update && apk add git curl build-base openmp-dev bash +FROM ubuntu:lunar +RUN apt update && apt install -y \ + build-essential \ + curl \ + git \ + bash \ + libomp-dev -COPY --from=0 /usr/src/barretenberg/cpp/build/bin /usr/src/barretenberg/cpp/build/bin -COPY --from=0 /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db +COPY --from=builder /usr/src/barretenberg/cpp/build/bin /usr/src/barretenberg/cpp/build/bin +COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db WORKDIR /usr/src/barretenberg/sol COPY ./sol . -# Copy forge binary directly from foundry -COPY --from=ghcr.io/foundry-rs/foundry:latest /usr/local/bin/forge /usr/local/bin/forge +# Download and install foundry +RUN curl -L https://foundry.paradigm.xyz | bash +ENV PATH="${PATH}:/root/.foundry/bin" +RUN foundryup RUN cd ../cpp/srs_db && ./download_ignition.sh 3 && cd ../../sol RUN ./scripts/init.sh # TestBase is excluded as it is just boilerplate -RUN forge test --no-match-contract TestBase \ No newline at end of file +RUN forge test --no-match-contract TestBase diff --git a/barretenberg/ts/Dockerfile b/barretenberg/ts/Dockerfile index 855dc17be37..af5c2511a4a 100644 --- a/barretenberg/ts/Dockerfile +++ b/barretenberg/ts/Dockerfile @@ -1,6 +1,6 @@ FROM aztecprotocol/barretenberg-wasm-linux-clang -FROM node:18.19.0-alpine +FROM node:18.19.0 COPY --from=0 /usr/src/barretenberg /usr/src/barretenberg # Create a standalone container that can run bb.js (and tests). @@ -17,4 +17,4 @@ RUN yarn formatting && SKIP_CPP_BUILD=1 yarn build CMD ["yarn", "test"] # We want to create a pure package, as would be published to npm, for consuming projects. -RUN yarn pack && tar zxf package.tgz && rm package.tgz && mv package ../ts \ No newline at end of file +RUN yarn pack && tar zxf package.tgz && rm package.tgz && mv package ../ts diff --git a/l1-contracts/Dockerfile b/l1-contracts/Dockerfile index 671da76b806..48064e89441 100644 --- a/l1-contracts/Dockerfile +++ b/l1-contracts/Dockerfile @@ -1,13 +1,27 @@ # Building requires foundry. -FROM ghcr.io/foundry-rs/foundry:nightly-4a643801d0b3855934cdec778e33e79c79971783 -RUN apk update && apk add git jq bash nodejs npm yarn python3 py3-pip && pip3 install slither-analyzer==0.10.0 slitherin==0.5.0 +FROM ubuntu:lunar + +RUN apt update && apt install curl git jq bash nodejs npm python3.11-full python3-pip -y + +# Use virtualenv, do not try to use pipx, it's not working. +RUN python3 -m venv /root/.venv +RUN /root/.venv/bin/pip3 install slither-analyzer==0.10.0 slitherin==0.5.0 +RUN curl -L https://foundry.paradigm.xyz | bash + +# Set env variables for foundry and venv +ENV PATH="${PATH}:/root/.foundry/bin:/root/.venv/bin" +RUN foundryup + WORKDIR /usr/src/l1-contracts COPY . . RUN git init RUN forge clean && forge fmt --check && forge build && forge test + +RUN npm install --global yarn RUN yarn && yarn lint + RUN git add . && yarn slither && yarn slither-has-diff RUN forge build FROM scratch -COPY --from=0 /usr/src/l1-contracts/out /usr/src/l1-contracts/out \ No newline at end of file +COPY --from=0 /usr/src/l1-contracts/out /usr/src/l1-contracts/out diff --git a/noir/Dockerfile.native b/noir/Dockerfile.native index 73a29b3de21..0ba100fe726 100644 --- a/noir/Dockerfile.native +++ b/noir/Dockerfile.native @@ -7,7 +7,7 @@ COPY . . RUN ./scripts/bootstrap_native.sh # When running the container, mount the users home directory to same location. -FROM ubuntu:focal +FROM ubuntu:lunar # Install Tini as nargo doesn't handle signals properly. # Install git as nargo needs it to clone. RUN apt-get update && apt-get install -y git tini && rm -rf /var/lib/apt/lists/* && apt-get clean