From e6b1700282b70e236f0d2df3fb4b341eb36331e2 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Tue, 11 Oct 2022 14:35:44 +0100 Subject: [PATCH] Migrate to s6v3 --- Dockerfile | 12 ++++++------ Dockerfile.aarch64 | 11 ++++++----- Dockerfile.armhf | 11 ++++++----- Jenkinsfile | 2 +- README.md | 1 + jenkins-vars.yml | 2 +- readme-vars.yml | 1 + .../init-bazarr-config/dependencies.d/init-config | 0 .../s6-rc.d/init-bazarr-config/run} | 0 root/etc/s6-overlay/s6-rc.d/init-bazarr-config/type | 1 + root/etc/s6-overlay/s6-rc.d/init-bazarr-config/up | 1 + .../dependencies.d/init-bazarr-config | 0 .../s6-rc.d/svc-bazarr/dependencies.d/init-services | 0 .../s6-overlay/s6-rc.d/svc-bazarr/notification-fd | 1 + root/etc/s6-overlay/s6-rc.d/svc-bazarr/run | 5 +++++ root/etc/s6-overlay/s6-rc.d/svc-bazarr/type | 1 + .../s6-rc.d/user/contents.d/init-bazarr-config | 0 .../s6-overlay/s6-rc.d/user/contents.d/svc-bazarr | 0 root/etc/services.d/bazarr/run | 10 ---------- 19 files changed, 31 insertions(+), 28 deletions(-) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-bazarr-config/dependencies.d/init-config rename root/etc/{cont-init.d/30-config => s6-overlay/s6-rc.d/init-bazarr-config/run} (100%) mode change 100644 => 100755 create mode 100644 root/etc/s6-overlay/s6-rc.d/init-bazarr-config/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-bazarr-config/up create mode 100644 root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-bazarr-config create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-bazarr/dependencies.d/init-services create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-bazarr/notification-fd create mode 100755 root/etc/s6-overlay/s6-rc.d/svc-bazarr/run create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-bazarr/type create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-bazarr-config create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-bazarr delete mode 100644 root/etc/services.d/bazarr/run diff --git a/Dockerfile b/Dockerfile index 2e90383..b4770be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:3.14 +FROM ghcr.io/linuxserver/baseimage-alpine:3.16 # set version label +ARG UNRAR_VERSION=6.1.7 ARG BUILD_DATE ARG VERSION ARG BAZARR_VERSION @@ -20,16 +21,15 @@ RUN \ libffi-dev \ libxml2-dev \ libxslt-dev \ + make \ python3-dev && \ echo "**** install packages ****" && \ apk add --no-cache \ - curl \ ffmpeg \ libxml2 \ libxslt \ py3-pip \ python3 \ - unrar \ unzip && \ echo "**** install bazarr ****" && \ if [ -z ${BAZARR_VERSION+x} ]; then \ @@ -45,11 +45,10 @@ RUN \ /tmp/bazarr.zip -d \ /app/bazarr/bin && \ rm -Rf /app/bazarr/bin/bin && \ - echo "UpdateMethod=docker\nBranch=master\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/bazarr/package_info && \ + echo "UpdateMethod=docker\nBranch=master\nPackageVersion=${VERSION}\nPackageAuthor=linuxserver.io" > /app/bazarr/package_info && \ echo "**** Install requirements ****" && \ pip3 install -U --no-cache-dir pip && \ - pip install lxml --no-binary :all: && \ - pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine/ -r \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.16/ -r \ /app/bazarr/bin/requirements.txt && \ echo "**** clean up ****" && \ apk del --purge \ @@ -64,4 +63,5 @@ COPY root/ / # ports and volumes EXPOSE 6767 + VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 8756a6f..97887d5 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,6 +1,7 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.16 # set version label +ARG UNRAR_VERSION=6.1.7 ARG BUILD_DATE ARG VERSION ARG BAZARR_VERSION @@ -20,16 +21,15 @@ RUN \ libffi-dev \ libxml2-dev \ libxslt-dev \ + make \ python3-dev && \ echo "**** install packages ****" && \ apk add --no-cache \ - curl \ ffmpeg \ libxml2 \ libxslt \ py3-pip \ python3 \ - unrar \ unzip && \ echo "**** install bazarr ****" && \ if [ -z ${BAZARR_VERSION+x} ]; then \ @@ -45,10 +45,10 @@ RUN \ /tmp/bazarr.zip -d \ /app/bazarr/bin && \ rm -Rf /app/bazarr/bin/bin && \ - echo "UpdateMethod=docker\nBranch=master\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/bazarr/package_info && \ + echo "UpdateMethod=docker\nBranch=master\nPackageVersion=${VERSION}\nPackageAuthor=linuxserver.io" > /app/bazarr/package_info && \ echo "**** Install requirements ****" && \ pip3 install -U --no-cache-dir pip && \ - pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine/ -r \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.16/ -r \ /app/bazarr/bin/requirements.txt && \ echo "**** clean up ****" && \ apk del --purge \ @@ -63,4 +63,5 @@ COPY root/ / # ports and volumes EXPOSE 6767 + VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 7b8c268..2b605de 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,6 +1,7 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.14 +FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.16 # set version label +ARG UNRAR_VERSION=6.1.7 ARG BUILD_DATE ARG VERSION ARG BAZARR_VERSION @@ -20,16 +21,15 @@ RUN \ libffi-dev \ libxml2-dev \ libxslt-dev \ + make \ python3-dev && \ echo "**** install packages ****" && \ apk add --no-cache \ - curl \ ffmpeg \ libxml2 \ libxslt \ py3-pip \ python3 \ - unrar \ unzip && \ echo "**** install bazarr ****" && \ if [ -z ${BAZARR_VERSION+x} ]; then \ @@ -45,10 +45,10 @@ RUN \ /tmp/bazarr.zip -d \ /app/bazarr/bin && \ rm -Rf /app/bazarr/bin/bin && \ - echo "UpdateMethod=docker\nBranch=master\nPackageVersion=${VERSION}\nPackageAuthor=[linuxserver.io](https://linuxserver.io)" > /app/bazarr/package_info && \ + echo "UpdateMethod=docker\nBranch=master\nPackageVersion=${VERSION}\nPackageAuthor=linuxserver.io" > /app/bazarr/package_info && \ echo "**** Install requirements ****" && \ pip3 install -U --no-cache-dir pip && \ - pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine/ -r \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.16/ -r \ /app/bazarr/bin/requirements.txt && \ echo "**** clean up ****" && \ apk del --purge \ @@ -63,4 +63,5 @@ COPY root/ / # ports and volumes EXPOSE 6767 + VOLUME /config diff --git a/Jenkinsfile b/Jenkinsfile index 2ff7d08..5abc652 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,7 +36,7 @@ pipeline { CI_DELAY='120' CI_DOCKERENV='TZ=US/Pacific' CI_AUTH='user:password' - CI_WEBPATH='' + CI_WEBPATH='/system/status' } stages { // Setup all the basic environment variables needed for the build diff --git a/README.md b/README.md index 1d155c4..77747ce 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **11.10.22:** - Rebase master branch to Alpine 3.16, migrate to s6v3. * **15.15.21:** - Temp fix for lxml, compile from scratch to avoid broken official wheel. * **25.10.21:** - Rebase to alpine 3.14. Fix numpy wheel. * **22.10.21:** - Added openblas package to prevent numpy error. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index cc58870..8823ec4 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -26,6 +26,6 @@ repo_vars: - CI_DELAY='120' - CI_DOCKERENV='TZ=US/Pacific' - CI_AUTH='user:password' - - CI_WEBPATH='' + - CI_WEBPATH='/system/status' sponsor_links: - { name: "Bazarr", url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XHHRWXT9YB7WE&source=url" } diff --git a/readme-vars.yml b/readme-vars.yml index 80d6521..b7c5545 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -45,6 +45,7 @@ app_setup_block: | # changelog changelogs: + - { date: "11.10.22:", desc: "Rebase master branch to Alpine 3.16, migrate to s6v3." } - { date: "15.15.21:", desc: "Temp fix for lxml, compile from scratch to avoid broken official wheel." } - { date: "25.10.21:", desc: "Rebase to alpine 3.14. Fix numpy wheel." } - { date: "22.10.21:", desc: "Added openblas package to prevent numpy error." } diff --git a/root/etc/s6-overlay/s6-rc.d/init-bazarr-config/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-bazarr-config/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/cont-init.d/30-config b/root/etc/s6-overlay/s6-rc.d/init-bazarr-config/run old mode 100644 new mode 100755 similarity index 100% rename from root/etc/cont-init.d/30-config rename to root/etc/s6-overlay/s6-rc.d/init-bazarr-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/init-bazarr-config/type b/root/etc/s6-overlay/s6-rc.d/init-bazarr-config/type new file mode 100644 index 0000000..3d92b15 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-bazarr-config/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-bazarr-config/up b/root/etc/s6-overlay/s6-rc.d/init-bazarr-config/up new file mode 100644 index 0000000..2d0b6ae --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-bazarr-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-bazarr-config/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-bazarr-config b/root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-bazarr-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-bazarr/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-bazarr/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-bazarr/notification-fd b/root/etc/s6-overlay/s6-rc.d/svc-bazarr/notification-fd new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-bazarr/notification-fd @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/svc-bazarr/run b/root/etc/s6-overlay/s6-rc.d/svc-bazarr/run new file mode 100755 index 0000000..56ca65d --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-bazarr/run @@ -0,0 +1,5 @@ +#!/usr/bin/with-contenv bash + +exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 6767" \ + s6-setuidgid abc python3 /app/bazarr/bin/bazarr.py --no-update --config /config diff --git a/root/etc/s6-overlay/s6-rc.d/svc-bazarr/type b/root/etc/s6-overlay/s6-rc.d/svc-bazarr/type new file mode 100644 index 0000000..1780f9f --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-bazarr/type @@ -0,0 +1 @@ +longrun \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-bazarr-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-bazarr-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-bazarr b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-bazarr new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/services.d/bazarr/run b/root/etc/services.d/bazarr/run deleted file mode 100644 index 05019cf..0000000 --- a/root/etc/services.d/bazarr/run +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/with-contenv bash - -if [ -n "${UMASK_SET}" ] && [ -z "${UMASK}" ]; then - echo -e "You are using a legacy method of defining umask\nplease update your environment variable from UMASK_SET to UMASK\nto keep the functionality after July 2021" - umask ${UMASK_SET} -fi - -exec \ - s6-setuidgid abc python3 /app/bazarr/bin/bazarr.py \ - --no-update --config /config