diff --git a/Dockerfile b/Dockerfile index 7c765a2..26f7360 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM lsiobase/alpine:3.6 -MAINTAINER saarg +FROM lsiobase/alpine:3.7 # set version label ARG BUILD_DATE ARG VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="saarg" -# install build packages RUN \ + echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies \ bzr \ curl \ @@ -19,8 +19,7 @@ RUN \ libressl-dev \ pcsc-lite-dev \ tar && \ - -# install runtime packages + echo "**** install runtime packages ****" && \ apk add --no-cache \ ccid \ libcrypto1.0 \ @@ -28,8 +27,7 @@ RUN \ libusb \ pcsc-lite \ pcsc-lite-libs && \ - -# compile oscam from source + echo "**** compile oscam ****" && \ bzr branch lp:oscam /tmp/oscam-svn && \ cd /tmp/oscam-svn && \ ./config.sh \ @@ -44,20 +42,31 @@ RUN \ LCDSUPPORT \ LEDSUPPORT \ READ_SDT_CHARSETS && \ - make \ + echo "**** 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 \ CONF_DIR=/config \ DEFAULT_PCSC_FLAGS="-I/usr/include/PCSC" \ NO_PLUS_TARGET=1 \ OSCAM_BIN=/usr/bin/oscam \ pcsc-libusb && \ - -# fix broken permissions from pcscd install. + set +ex && \ + echo "**** fix broken permissions from pcscd install ****" && \ chown root:root \ /usr/sbin/pcscd && \ chmod 755 \ /usr/sbin/pcscd && \ - -# install PCSC drivers for OmniKey devices + echo "**** install PCSC drivers ****" && \ mkdir -p \ /tmp/omnikey && \ curl -o \ @@ -68,13 +77,11 @@ RUN \ /tmp/omnikey --strip-components=2 && \ cd /tmp/omnikey && \ ./install && \ - -# fix group for card readers and add abc to dialout group + echo "**** fix group for card readers and add abc to dialout group ****" && \ groupmod -g 24 cron && \ groupmod -g 16 dialout && \ usermod -a -G 16 abc && \ - -# cleanup + echo "**** cleanup ****" && \ apk del --purge \ build-dependencies && \ rm -rf \ diff --git a/README.md b/README.md index 3a0743b..35e0c5c 100644 --- a/README.md +++ b/README.md @@ -100,10 +100,11 @@ The web interface is at port 8888. ## Versions -+ **19.10.2017:** Add ccid package for usb card readers. -+ **17.10.2017:** Switch to using bzr for source code, streamboard awol. -+ **28.05.2017:** Rebase to alpine 3.6. -+ **09.02.2017:** Rebase to alpine 3.5. -+ **14.10.2016:** Add version layer information. -+ **02.10.2016:** Add info on passing through devices to README. -+ **25.09.2016:** Initial release. ++ **13.12.17:** Rebase to alpine 3.7. ++ **19.10.17:** Add ccid package for usb card readers. ++ **17.10.17:** Switch to using bzr for source code, streamboard awol. ++ **28.05.17:** Rebase to alpine 3.6. ++ **09.02.17:** Rebase to alpine 3.5. ++ **14.10.16:** Add version layer information. ++ **02.10.16:** Add info on passing through devices to README. ++ **25.09.16:** Initial release.