Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

add Dockerfile for building rapidsnark #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:experimental

FROM node:lts-bullseye-slim AS builder
ARG BUILDARGS
ARG TARGET=x86_64
ARG GMP_TARGET=host
WORKDIR /src
COPY . .

RUN apt update && \
apt install -y curl build-essential cmake git nasm m4 && \
git submodule init && git submodule update && \
./build_gmp.sh $GMP_TARGET

RUN mkdir build_prover && \
cd build_prover && \
cmake .. -DTARGET_PLATFORM=$TARGET -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package && \
make -j2 && make install

ENTRYPOINT ["/bin/bash"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,24 @@ cmake .. -GXcode -DTARGET_PLATFORM=IOS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTAL
Open generated Xcode project and compile prover.


## Using Docker

You might use the Dockerfile avialable on this repository for setting up the build environment and perform the compilation.

To create the docker image, execute:

`docker image build -t rapidsnark .`

The image compiles rapidsnark and libgpm for host x86_64.

You can create a new container and access to bash (source code available in /src directory).

`docker run -it rapidsnark`

Then you can extract the compiled files by executing the following docker command:

`docker cp <container_id>:/src/package rapidsnark_package`

## Building proof

You have a full prover compiled in the build directory.
Expand Down