diff --git a/Dockerfile b/Dockerfile index 4dca25b..a3ed0a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM lsiobase/alpine:3.8 as buildstage +FROM lsiobase/alpine:3.9 as buildstage ############## build stage ############## # package versions @@ -135,7 +135,7 @@ RUN \ sed "s/\(lib\/Ask\/Term.pm';\)/.\/\1/" -i Makefile.PL && \ PERL5LIB=`pwd` && \ echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor && \ - make && \ + make -j 2 && \ make test && \ make DESTDIR=/tmp/xmltv-build install @@ -179,7 +179,7 @@ RUN \ --mandir=/usr/share/man \ --prefix=/usr \ --sysconfdir=/config && \ - make && \ + make -j 2 && \ make DESTDIR=/tmp/tvheadend-build install RUN \ @@ -197,7 +197,7 @@ RUN \ cd /tmp/argtable && \ ./configure \ --prefix=/usr && \ - make && \ + make -j 2 && \ make check && \ make DESTDIR=/tmp/argtable-build install && \ echo "**** copy to /usr for comskip dependency ****" && \ @@ -211,11 +211,11 @@ RUN \ ./configure \ --bindir=/usr/bin \ --sysconfdir=/config/comskip && \ - make && \ + make -j 2 && \ make DESTDIR=/tmp/comskip-build install ############## runtime stage ############## -FROM lsiobase/alpine:3.8 +FROM lsiobase/alpine:3.9 # set version label ARG BUILD_DATE @@ -235,11 +235,11 @@ RUN \ ffmpeg \ ffmpeg-libs \ gzip \ - libcrypto1.0 \ + libcrypto1.1 \ libcurl \ libhdhomerun-libs \ libressl \ - libssl1.0 \ + libssl1.1 \ libvpx \ libxml2 \ libxslt \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 081377b..61e78b2 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,4 @@ -FROM lsiobase/alpine:arm64v8-3.8 as buildstage +FROM lsiobase/alpine:arm64v8-3.9 as buildstage ############## build stage ############## # package versions @@ -135,7 +135,7 @@ RUN \ sed "s/\(lib\/Ask\/Term.pm';\)/.\/\1/" -i Makefile.PL && \ PERL5LIB=`pwd` && \ echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor && \ - make && \ + make -j 2 && \ make test && \ make DESTDIR=/tmp/xmltv-build install @@ -179,7 +179,7 @@ RUN \ --mandir=/usr/share/man \ --prefix=/usr \ --sysconfdir=/config && \ - make && \ + make -j 2 && \ make DESTDIR=/tmp/tvheadend-build install RUN \ @@ -197,7 +197,7 @@ RUN \ cd /tmp/argtable && \ ./configure \ --prefix=/usr && \ - make && \ + make -j 2 && \ make check && \ make DESTDIR=/tmp/argtable-build install && \ echo "**** copy to /usr for comskip dependency ****" && \ @@ -211,11 +211,11 @@ RUN \ ./configure \ --bindir=/usr/bin \ --sysconfdir=/config/comskip && \ - make && \ + make -j 2 && \ make DESTDIR=/tmp/comskip-build install ############## runtime stage ############## -FROM lsiobase/alpine:arm64v8-3.8 +FROM lsiobase/alpine:arm64v8-3.9 # set version label ARG BUILD_DATE @@ -235,11 +235,11 @@ RUN \ ffmpeg \ ffmpeg-libs \ gzip \ - libcrypto1.0 \ + libcrypto1.1 \ libcurl \ libhdhomerun-libs \ libressl \ - libssl1.0 \ + libssl1.1 \ libvpx \ libxml2 \ libxslt \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index a27c360..835ebb9 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,4 @@ -FROM lsiobase/alpine:arm32v7-3.8 as buildstage +FROM lsiobase/alpine:arm32v7-3.9 as buildstage ############## build stage ############## # package versions @@ -135,7 +135,7 @@ RUN \ sed "s/\(lib\/Ask\/Term.pm';\)/.\/\1/" -i Makefile.PL && \ PERL5LIB=`pwd` && \ echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor && \ - make && \ + make -j 2 && \ make test && \ make DESTDIR=/tmp/xmltv-build install @@ -179,7 +179,7 @@ RUN \ --mandir=/usr/share/man \ --prefix=/usr \ --sysconfdir=/config && \ - make && \ + make -j 2 && \ make DESTDIR=/tmp/tvheadend-build install RUN \ @@ -197,7 +197,7 @@ RUN \ cd /tmp/argtable && \ ./configure \ --prefix=/usr && \ - make && \ + make -j 2 && \ make check && \ make DESTDIR=/tmp/argtable-build install && \ echo "**** copy to /usr for comskip dependency ****" && \ @@ -211,11 +211,11 @@ RUN \ ./configure \ --bindir=/usr/bin \ --sysconfdir=/config/comskip && \ - make && \ + make -j 2 && \ make DESTDIR=/tmp/comskip-build install ############## runtime stage ############## -FROM lsiobase/alpine:arm32v7-3.8 +FROM lsiobase/alpine:arm32v7-3.9 # set version label ARG BUILD_DATE @@ -235,11 +235,11 @@ RUN \ ffmpeg \ ffmpeg-libs \ gzip \ - libcrypto1.0 \ + libcrypto1.1 \ libcurl \ libhdhomerun-libs \ libressl \ - libssl1.0 \ + libssl1.1 \ libvpx \ libxml2 \ libxslt \ diff --git a/README.md b/README.md index cbcbaf7..8bbc113 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,7 @@ Below are the instructions for updating containers: ## Versions +* **27.03.19:** - Rebase to Alpine 3.9, fix init logic to only chown once. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. * **17.02.19:** - Bump xmltv to 5.70, ensure version tagging works by cloning tvheadend. * **14.02.19:** - Add picons path to config. diff --git a/readme-vars.yml b/readme-vars.yml index d4cfc76..9864585 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -125,6 +125,7 @@ app_setup_block: | # changelog changelogs: + - { date: "27.03.19:", desc: "Rebase to Alpine 3.9, fix init logic to only chown once." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." } - { date: "17.02.19:", desc: "Bump xmltv to 5.70, ensure version tagging works by cloning tvheadend." } - { date: "14.02.19:", desc: "Add picons path to config." } diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index 6fff236..7f80035 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -13,7 +13,29 @@ mkdir -p \ (cp /defaults/config /config/config) -# permissions -chown -R abc:abc \ - /config \ - /picons + +# function to randomly sample 10 files for their owner and only chown if not abc +chowner () { +files=(${1}/*) +for i in {1..10}; do + user=$(stat -c '%U' $(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")) + if [ "${user}" != "abc" ]; then + chown -R abc:abc ${1} + break + fi +done +} + +# permissions +echo "Setting permissions" +abc_dirs=( \ +/config \ +/picons \ +) +for i in "${abc_dirs[@]}"; do + if [ "$(ls -A ${i})" ]; then + chowner ${i} + else + chown -R abc:abc ${i} + fi +done