Skip to content
This repository was archived by the owner on Jan 1, 2024. It is now read-only.

Commit cbf7d1f

Browse files
authored
Merge pull request #13 from linuxserver/cpu_core_stable-3.8153
cpu counting for faster builds (hopefully)
2 parents 14bca4a + 475618b commit cbf7d1f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Dockerfile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,22 @@ RUN \
9797
-DUSE_STATIC_LIBSTDCXX=OFF \
9898
-DUSE_STATIC_OPENZWAVE=OFF \
9999
-Wno-dev && \
100-
make && \
100+
# attempt to set number of cores available for make to use
101+
set -ex && \
102+
CPU_CORES=$( < /proc/cpuinfo grep -c processor ) || echo "failed cpu look up" && \
103+
if echo $CPU_CORES | grep -E -q '^[0-9]+$'; then \
104+
: ;\
105+
if [ "$CPU_CORES" -gt 7 ]; then \
106+
CPU_CORES=$(( CPU_CORES - 3 )); \
107+
elif [ "$CPU_CORES" -gt 5 ]; then \
108+
CPU_CORES=$(( CPU_CORES - 2 )); \
109+
elif [ "$CPU_CORES" -gt 3 ]; then \
110+
CPU_CORES=$(( CPU_CORES - 1 )); fi \
111+
else CPU_CORES="1"; fi && \
112+
113+
make -j $CPU_CORES && \
101114
make install && \
115+
set +ex && \
102116

103117
# determine runtime packages
104118
RUNTIME_PACKAGES="$( \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ The user manual is available at [www.domoticz.com][appurl]
106106

107107
## Versions
108108

109+
+ **26.11.2017:** Use cpu core counting routine to speed up build time.
109110
+ **01.10.2017:** Add branch for stable-3.8153.
110111
+ **28.05.2017:** Rebase to alpine 3.6.
111112
+ **26.02.2017:** Add curl and replace openssl with libressl.

0 commit comments

Comments
 (0)