use cpu core routine
This commit is contained in:
parent
e6c8a325e5
commit
c33a1ce348
16
Dockerfile
16
Dockerfile
@ -71,7 +71,21 @@ RUN \
|
||||
--without-x \
|
||||
--with-tiff \
|
||||
--with-xml && \
|
||||
make && \
|
||||
# attempt to set number of cores available for make to use
|
||||
set -ex && \
|
||||
CPU_CORES=$( < /proc/cpuinfo grep -c processor ) || echo "failed cpu look up" && \
|
||||
if echo $CPU_CORES | grep -E -q '^[0-9]+$'; then \
|
||||
: ;\
|
||||
if [ "$CPU_CORES" -gt 7 ]; then \
|
||||
CPU_CORES=$(( CPU_CORES - 3 )); \
|
||||
elif [ "$CPU_CORES" -gt 5 ]; then \
|
||||
CPU_CORES=$(( CPU_CORES - 2 )); \
|
||||
elif [ "$CPU_CORES" -gt 3 ]; then \
|
||||
CPU_CORES=$(( CPU_CORES - 1 )); fi \
|
||||
else CPU_CORES="1"; fi && \
|
||||
|
||||
make -j $CPU_CORES && \
|
||||
set +ex && \
|
||||
make install && \
|
||||
find / -name '.packlist' -o -name 'perllocal.pod' \
|
||||
-o -name '*.bs' -delete && \
|
||||
|
Loading…
Reference in New Issue
Block a user