From 7481add44ae9dfc0dca990549cff18c7bf501feb Mon Sep 17 00:00:00 2001 From: Nick Volynkin Date: Mon, 13 Nov 2023 15:28:46 +0200 Subject: [PATCH] docker: build an image with zkLLVM and proof-generator --- Dockerfile | 26 ++++++++++++++++++++++++++ README.md | 16 ++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..02e031bc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM ghcr.io/nilfoundation/proof-market-toolchain:base + +WORKDIR /opt/nil-toolchain + +COPY . /opt/nil-toolchain + +RUN mkdir -p build \ + && cd ./build \ + && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 .. \ + && cmake --build . \ + && ln -s /opt/nil-toolchain/build/bin/proof-generator/proof-generator /usr/bin/proof-generator \ + && mkdir /root/.config \ + && touch /root/.config/config.ini + +ARG ZKLLVM_VERSION=0.1.7 + +RUN DEBIAN_FRONTEND=noninteractive \ + echo 'deb [trusted=yes] http://deb.nil.foundation/ubuntu/ all main' >> /etc/apt/sources.list \ + && apt-get update \ + && apt-get -y --no-install-recommends --no-install-suggests install \ + build-essential \ + cmake \ + git \ + zkllvm=${ZKLLVM_VERSION} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index 1f51bb67..c1691aa4 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,19 @@ ${ZKLLVM_BUILD:-build}/bin/assigner/assigner -b ${ZKLLVM_BUILD:-build}/examples/ ``` ./bin/proof-generator/proof-generator --circuit=./merkle_tree_sha2_256_circuit.crt --assignment-table=/balances_tree.tbl --proof=./proof.txt ``` + +## Toolchain Docker image + +Build an image: + +```bash +docker build -t ghcr.io/nilfoundation/toolchain:0.1.7 -t ghcr.io/nilfoundation/toolchain:latest . +``` + +Push it to the registry: + +```bash +docker login ghcr.io +docker push ghcr.io/nilfoundation/toolchain:0.1.7 +docker push ghcr.io/nilfoundation/toolchain:latest +``` \ No newline at end of file