From 37f9c6e6510a6cde583d7bf1530c1d7d87b3c8ab Mon Sep 17 00:00:00 2001 From: MoroccanMalinois Date: Mon, 11 Dec 2017 23:33:08 +0000 Subject: [PATCH] Dockerfile: add option to set build parallelism --- Dockerfile | 4 +++- README.md | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 71b0658a0..a62e263cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,10 @@ RUN apt-get update && \ WORKDIR /src COPY . . + +ARG NPROC RUN rm -rf build && \ - make -j$(nproc) release-static + if [ -z "$NPROC" ];then make -j$(nproc) release-static;else make -j$NPROC release-static;fi # runtime stage FROM ubuntu:16.04 diff --git a/README.md b/README.md index 4386aacaa..27468dc09 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,11 @@ Installing a snap is very quick. Snaps are secure. They are isolated with all of * Docker + # Build using all available cores docker build -t monero . + + # or build using a specific number of cores (reduce RAM requirement) + docker build --build-arg NPROC=1 -t monero . # either run in foreground docker run -it -v /monero/chain:/root/.bitmonero -v /monero/wallet:/wallet -p 18080:18080 monero