diff --git a/Dockerfile b/Dockerfile index 147c362d..2649efac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM ubuntu:20.04 # Avoid prompts from apt-get ARG DEBIAN_FRONTEND=noninteractive +ARG NTHREADS=18 RUN apt-get update && apt-get install -y software-properties-common RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && apt-get update @@ -34,7 +35,7 @@ RUN cd blocksci && \ mkdir build && \ cd build && \ CC=gcc-7 CXX=g++-7 cmake -DCMAKE_BUILD_TYPE=Release .. && \ - make -j258 && \ + make -j${NTHREADS} && \ make install diff --git a/README.md b/README.md index c9094474..ba6c8a9e 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,9 @@ To run BlockSci in Docker, the following steps are required: 1. Clone this repository 1. You also need to clone with submodules. For that, either use `--recurse-submodules` while cloning, or, in the cloned repository, follow with `git submodule init` and `git submodule update --recursive`. 2. Install [Docker](https://docs.docker.com/get-docker/) -3. Build the Docker image by running `docker build -t blocksci-cj .` in the root of the repository. This is just an initial setup to get all the libraries, and the *real* compilation will happen later. +3. Build the Docker image by running `docker build --build-arg NTHREADS= -t blocksci-cj .` in the root of the repository. This is just an initial setup to get all the libraries, and the *real* compilation will happen later. 1. We use `uv` to speed up the `blockscipy` installation, since it takes a long time. + 2. Use NTHREADS build argument to control how many threads are used (passed to `make -j${NTHREADS}`). Now - since BlockSci is a memory-intensive and disk-consuming tool, we **strongly** recommend you to not hold the BlockSci data directly in the image, but to mount a persistent volume to the container.