reverse elif and if for cpu cores

This commit is contained in:
sparklyballs 2017-08-30 10:53:47 +01:00
parent 30579d3e3b
commit 7079f9defc

View File

@ -114,10 +114,10 @@ RUN set -ex && \
# as one less than actual available, if 6 or more set to two less than available, otherwise use all cores
RUN \
CPU_CORES=$(cat /proc/cpuinfo | grep processor | wc -l) && \
if [ $CPU_CORES -gt 3 ]; then \
CPU_CORES=$(expr $CPU_CORES - 1); \
elif [ $CPU_CORES -gt 5 ]; then \
if [ $CPU_CORES -gt 5 ]; then \
CPU_CORES=$(expr $CPU_CORES - 2); \
elif [ $CPU_CORES -gt 3 ]; then \
CPU_CORES=$(expr $CPU_CORES - 1); \
fi && \
echo $CPU_CORES > /tmp/cpu-cores