diff --git a/barretenberg/acir_tests/Dockerfile.bb b/barretenberg/acir_tests/Dockerfile.bb index e0267b013458..f7123707612e 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 98cb85c364a1..0883035bb4b3 100644 --- a/barretenberg/acir_tests/Dockerfile.bb.sol +++ b/barretenberg/acir_tests/Dockerfile.bb.sol @@ -2,14 +2,21 @@ 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 +# 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 every acir test through a solidity verifier. RUN (cd sol-test && yarn) -RUN PARALLEL=1 FLOW=sol ./run_acir_tests.sh +CMD ["/bin/bash"] +# RUN PARALLEL=1 FLOW=sol ./run_acir_tests.sh + diff --git a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert index 9276245c00c8..a958ead8b837 100644 --- a/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert +++ b/barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert @@ -25,9 +25,7 @@ COPY . . RUN ./format.sh check && cmake --preset clang16 -DCMAKE_BUILD_TYPE=RelWithAssert -DCI=ON && cmake --build --preset clang16 RUN srs_db/download_grumpkin.sh -CMD ["/bin/bash"] - -# 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 +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 diff --git a/barretenberg/sol/Dockerfile b/barretenberg/sol/Dockerfile index df99298fb85c..b44f7547e445 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,30 @@ 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 - -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 +# 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=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 +# COPY --from=ghcr.io/foundry-rs/foundry:latest /usr/local/bin/forge /usr/local/bin/forge +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 855dc17be37a..af5c2511a4a6 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 671da76b8065..44ef16c676e8 100644 --- a/l1-contracts/Dockerfile +++ b/l1-contracts/Dockerfile @@ -1,6 +1,13 @@ # 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 ghcr.io/foundry-rs/foundry:nightly-4a643801d0b3855934cdec778e33e79c79971783 +FROM ubuntu:lunar +RUN apt update && apt install git jq bash nodejs npm yarn python3 py3-pip -y && pip3 install slither-analyzer==0.10.0 slitherin==0.5.0 + +RUN curl -L https://foundry.paradigm.xyz | bash +RUN source ~/.bashrc +ENV PATH="~/.foundry/bin:${PATH}" +RUN foundryup + WORKDIR /usr/src/l1-contracts COPY . . RUN git init @@ -10,4 +17,4 @@ 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 73a29b3de21e..0ba100fe7263 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