Skip to content

Commit

Permalink
docker: build an image with zkLLVM and proof-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
NickVolynkin authored and nkaskov committed Nov 15, 2023
1 parent fbcf856 commit 7481add
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/*
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit 7481add

Please sign in to comment.