From 16e95cb3ae8baaaca05319b2b776435f8307ae22 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 24 Dec 2022 17:17:33 -0600 Subject: [PATCH] Rebasing nightly to alpine 3.17 --- Dockerfile | 50 ++++++++----------- Dockerfile.aarch64 | 50 ++++++++----------- Dockerfile.armhf | 50 ++++++++----------- readme-vars.yml | 1 + root/defaults/beets.sh | 7 +-- root/etc/cont-init.d/30-config | 11 ---- .../dependencies.d/init-config | 0 .../s6-overlay/s6-rc.d/init-beets-config/run | 10 ++++ .../s6-overlay/s6-rc.d/init-beets-config/type | 1 + .../s6-overlay/s6-rc.d/init-beets-config/up | 1 + .../svc-beets/dependencies.d/init-services | 0 .../s6-rc.d/svc-beets/notification-fd | 1 + root/etc/s6-overlay/s6-rc.d/svc-beets/run | 6 +++ root/etc/s6-overlay/s6-rc.d/svc-beets/type | 1 + .../s6-rc.d/user/contents.d/init-beets-config | 0 .../s6-rc.d/user/contents.d/svc-beets | 0 root/etc/services.d/beets/run | 5 -- 17 files changed, 88 insertions(+), 106 deletions(-) delete mode 100644 root/etc/cont-init.d/30-config create mode 100644 root/etc/s6-overlay/s6-rc.d/init-beets-config/dependencies.d/init-config create mode 100755 root/etc/s6-overlay/s6-rc.d/init-beets-config/run create mode 100644 root/etc/s6-overlay/s6-rc.d/init-beets-config/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-beets-config/up create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-beets/dependencies.d/init-services create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-beets/notification-fd create mode 100755 root/etc/s6-overlay/s6-rc.d/svc-beets/run create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-beets/type create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/init-beets-config create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-beets delete mode 100644 root/etc/services.d/beets/run diff --git a/Dockerfile b/Dockerfile index 0b75777..540fee5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -ARG ALPINE_VER="3.15" +# syntax=docker/dockerfile:1 + +ARG ALPINE_VER="3.17" FROM ghcr.io/linuxserver/baseimage-alpine:${ALPINE_VER} as fetch-stage ############## fetch stage ############## @@ -10,11 +12,7 @@ ARG MP3VAL_VER="0.1.8" # install fetch packages RUN \ apk add --no-cache \ - bash \ - curl \ - git \ - jq \ - unzip + git # set shell SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -27,18 +25,18 @@ RUN \ /tmp/mp3gain-src \ /tmp/mp3val-src && \ if [ -z ${BEETS_VERSION+x} ] ; then \ - BEETS_RAW_COMMIT=$(curl -sX GET "https://api.github.com/repos/beetbox/beets/commits/master" \ + BEETS_RAW_COMMIT=$(curl -sX GET "https://api.github.com/repos/beetbox/beets/commits/master" \ | jq -r .sha) && \ - BEETS_VERSION="${BEETS_RAW_COMMIT:0:7}"; \ + BEETS_VERSION="${BEETS_RAW_COMMIT:0:7}"; \ fi && \ curl -o \ - /tmp/beets.tar.gz -sL \ + /tmp/beets.tar.gz -sL \ "https://github.com/sampsyo/beets/archive/${BEETS_VERSION}.tar.gz" && \ curl -o \ - /tmp/mp3gain.zip -sL \ + /tmp/mp3gain.zip -sL \ "https://sourceforge.net/projects/mp3gain/files/mp3gain/${MP3GAIN_VER}/mp3gain-${MP3GAIN_VER//./_}-src.zip" && \ curl -o \ - /tmp/mp3val.tar.gz -sL \ + /tmp/mp3val.tar.gz -sL \ "https://downloads.sourceforge.net/mp3val/mp3val-${MP3VAL_VER}-src.tar.gz" && \ tar xf \ /tmp/beets.tar.gz -C \ @@ -94,8 +92,7 @@ WORKDIR /tmp/mp3gain-src # install build packages RUN \ apk add --no-cache \ - g++ \ - make \ + build-base \ mpg123-dev # build package @@ -120,8 +117,7 @@ WORKDIR /tmp/mp3val-src # install build packages RUN \ apk add --no-cache \ - g++ \ - make + build-base # build package RUN \ @@ -144,11 +140,10 @@ WORKDIR /tmp/chromaprint-src # install build packages RUN \ apk add --no-cache \ + build-base \ cmake \ ffmpeg-dev \ - fftw-dev \ - g++ \ - make + fftw-dev # build package RUN \ @@ -167,16 +162,18 @@ FROM ghcr.io/linuxserver/baseimage-alpine:${ALPINE_VER} as pip-stage # install build packages RUN \ apk add --no-cache \ - g++ \ - make \ - py3-pip \ + build-base \ + cargo \ python3-dev # install pip packages RUN \ set -ex && \ - python3 -m pip install --upgrade pip && \ - pip3 install --no-cache-dir -U --find-links https://wheel-index.linuxserver.io/alpine/ \ + python3 -m ensurepip && \ + pip3 install -U --no-cache-dir \ + pip \ + wheel && \ + pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \ confuse \ discogs-client \ enum34 \ @@ -231,7 +228,6 @@ COPY --from=strip-stage /build/all/usr/ /usr/ # install runtime packages RUN \ apk add --no-cache \ - curl \ ffmpeg \ fftw \ flac \ @@ -239,7 +235,6 @@ RUN \ gstreamer \ mpg123 \ nano \ - jq \ lame \ nano \ py3-beautifulsoup4 \ @@ -249,15 +244,12 @@ RUN \ py3-munkres \ py3-musicbrainzngs \ py3-pillow \ - py3-pip \ py3-pylast \ py3-requests \ py3-setuptools \ py3-six \ python3 \ - sqlite-libs \ - tar \ - wget + sqlite-libs # environment settings ENV BEETSDIR="/config" \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 947158a..49cbc6d 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,6 @@ -ARG ALPINE_VER="3.15" +# syntax=docker/dockerfile:1 + +ARG ALPINE_VER="3.17" FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-${ALPINE_VER} as fetch-stage ############## fetch stage ############## @@ -10,11 +12,7 @@ ARG MP3VAL_VER="0.1.8" # install fetch packages RUN \ apk add --no-cache \ - bash \ - curl \ - git \ - jq \ - unzip + git # set shell SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -27,18 +25,18 @@ RUN \ /tmp/mp3gain-src \ /tmp/mp3val-src && \ if [ -z ${BEETS_VERSION+x} ] ; then \ - BEETS_RAW_COMMIT=$(curl -sX GET "https://api.github.com/repos/beetbox/beets/commits/master" \ + BEETS_RAW_COMMIT=$(curl -sX GET "https://api.github.com/repos/beetbox/beets/commits/master" \ | jq -r .sha) && \ - BEETS_VERSION="${BEETS_RAW_COMMIT:0:7}"; \ + BEETS_VERSION="${BEETS_RAW_COMMIT:0:7}"; \ fi && \ curl -o \ - /tmp/beets.tar.gz -sL \ + /tmp/beets.tar.gz -sL \ "https://github.com/sampsyo/beets/archive/${BEETS_VERSION}.tar.gz" && \ curl -o \ - /tmp/mp3gain.zip -sL \ + /tmp/mp3gain.zip -sL \ "https://sourceforge.net/projects/mp3gain/files/mp3gain/${MP3GAIN_VER}/mp3gain-${MP3GAIN_VER//./_}-src.zip" && \ curl -o \ - /tmp/mp3val.tar.gz -sL \ + /tmp/mp3val.tar.gz -sL \ "https://downloads.sourceforge.net/mp3val/mp3val-${MP3VAL_VER}-src.tar.gz" && \ tar xf \ /tmp/beets.tar.gz -C \ @@ -94,8 +92,7 @@ WORKDIR /tmp/mp3gain-src # install build packages RUN \ apk add --no-cache \ - g++ \ - make \ + build-base \ mpg123-dev # build package @@ -120,8 +117,7 @@ WORKDIR /tmp/mp3val-src # install build packages RUN \ apk add --no-cache \ - g++ \ - make + build-base # build package RUN \ @@ -144,11 +140,10 @@ WORKDIR /tmp/chromaprint-src # install build packages RUN \ apk add --no-cache \ + build-base \ cmake \ ffmpeg-dev \ - fftw-dev \ - g++ \ - make + fftw-dev # build package RUN \ @@ -167,16 +162,18 @@ FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-${ALPINE_VER} as pip-stage # install build packages RUN \ apk add --no-cache \ - g++ \ - make \ - py3-pip \ + build-base \ + cargo \ python3-dev # install pip packages RUN \ set -ex && \ - python3 -m pip install --upgrade pip && \ - pip3 install --no-cache-dir -U --find-links https://wheel-index.linuxserver.io/alpine/ \ + python3 -m ensurepip && \ + pip3 install -U --no-cache-dir \ + pip \ + wheel && \ + pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \ confuse \ discogs-client \ enum34 \ @@ -231,7 +228,6 @@ COPY --from=strip-stage /build/all/usr/ /usr/ # install runtime packages RUN \ apk add --no-cache \ - curl \ ffmpeg \ fftw \ flac \ @@ -239,7 +235,6 @@ RUN \ gstreamer \ mpg123 \ nano \ - jq \ lame \ nano \ py3-beautifulsoup4 \ @@ -249,15 +244,12 @@ RUN \ py3-munkres \ py3-musicbrainzngs \ py3-pillow \ - py3-pip \ py3-pylast \ py3-requests \ py3-setuptools \ py3-six \ python3 \ - sqlite-libs \ - tar \ - wget + sqlite-libs # environment settings ENV BEETSDIR="/config" \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index f0b3f34..cdc7156 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,4 +1,6 @@ -ARG ALPINE_VER="3.15" +# syntax=docker/dockerfile:1 + +ARG ALPINE_VER="3.17" FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-${ALPINE_VER} as fetch-stage ############## fetch stage ############## @@ -10,11 +12,7 @@ ARG MP3VAL_VER="0.1.8" # install fetch packages RUN \ apk add --no-cache \ - bash \ - curl \ - git \ - jq \ - unzip + git # set shell SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -27,18 +25,18 @@ RUN \ /tmp/mp3gain-src \ /tmp/mp3val-src && \ if [ -z ${BEETS_VERSION+x} ] ; then \ - BEETS_RAW_COMMIT=$(curl -sX GET "https://api.github.com/repos/beetbox/beets/commits/master" \ + BEETS_RAW_COMMIT=$(curl -sX GET "https://api.github.com/repos/beetbox/beets/commits/master" \ | jq -r .sha) && \ - BEETS_VERSION="${BEETS_RAW_COMMIT:0:7}"; \ + BEETS_VERSION="${BEETS_RAW_COMMIT:0:7}"; \ fi && \ curl -o \ - /tmp/beets.tar.gz -sL \ + /tmp/beets.tar.gz -sL \ "https://github.com/sampsyo/beets/archive/${BEETS_VERSION}.tar.gz" && \ curl -o \ - /tmp/mp3gain.zip -sL \ + /tmp/mp3gain.zip -sL \ "https://sourceforge.net/projects/mp3gain/files/mp3gain/${MP3GAIN_VER}/mp3gain-${MP3GAIN_VER//./_}-src.zip" && \ curl -o \ - /tmp/mp3val.tar.gz -sL \ + /tmp/mp3val.tar.gz -sL \ "https://downloads.sourceforge.net/mp3val/mp3val-${MP3VAL_VER}-src.tar.gz" && \ tar xf \ /tmp/beets.tar.gz -C \ @@ -94,8 +92,7 @@ WORKDIR /tmp/mp3gain-src # install build packages RUN \ apk add --no-cache \ - g++ \ - make \ + build-base \ mpg123-dev # build package @@ -120,8 +117,7 @@ WORKDIR /tmp/mp3val-src # install build packages RUN \ apk add --no-cache \ - g++ \ - make + build-base # build package RUN \ @@ -144,11 +140,10 @@ WORKDIR /tmp/chromaprint-src # install build packages RUN \ apk add --no-cache \ + build-base \ cmake \ ffmpeg-dev \ - fftw-dev \ - g++ \ - make + fftw-dev # build package RUN \ @@ -167,16 +162,18 @@ FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-${ALPINE_VER} as pip-stage # install build packages RUN \ apk add --no-cache \ - g++ \ - make \ - py3-pip \ + build-base \ + cargo \ python3-dev # install pip packages RUN \ set -ex && \ - python3 -m pip install --upgrade pip && \ - pip3 install --no-cache-dir -U --find-links https://wheel-index.linuxserver.io/alpine/ \ + python3 -m ensurepip && \ + pip3 install -U --no-cache-dir \ + pip \ + wheel && \ + pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ \ confuse \ discogs-client \ enum34 \ @@ -231,7 +228,6 @@ COPY --from=strip-stage /build/all/usr/ /usr/ # install runtime packages RUN \ apk add --no-cache \ - curl \ ffmpeg \ fftw \ flac \ @@ -239,7 +235,6 @@ RUN \ gstreamer \ mpg123 \ nano \ - jq \ lame \ nano \ py3-beautifulsoup4 \ @@ -249,15 +244,12 @@ RUN \ py3-munkres \ py3-musicbrainzngs \ py3-pillow \ - py3-pip \ py3-pylast \ py3-requests \ py3-setuptools \ py3-six \ python3 \ - sqlite-libs \ - tar \ - wget + sqlite-libs # environment settings ENV BEETSDIR="/config" \ diff --git a/readme-vars.yml b/readme-vars.yml index 19b64c7..1ec5ef0 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -33,6 +33,7 @@ param_ports: # changelog changelogs: + - { date: "24.12.22:", desc: "Rebasing to alpine 3.17." } - { date: "15.01.22:", desc: "Rebase to Alpine 3.15." } - { date: "02.06.21:", desc: "Add back gstreamer packages." } - { date: "24.05.21:", desc: "Add missing changes from master branch." } diff --git a/root/defaults/beets.sh b/root/defaults/beets.sh index 5ab4b8c..7902fe3 100644 --- a/root/defaults/beets.sh +++ b/root/defaults/beets.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/with-contenv bash +# shellcheck shell=bash # # beets music tagger - post-processing script # @@ -8,7 +9,7 @@ # $1 - Fullpath of directory to be processed. eg./mnt/user/downloads/some.artist_some.album # $7 - Status of post processing. 0 = OK, 1 = failed verification, 2 = failed unpack, 3 = 1+2 -if [ ! -z "$7" ] && [ "$7" -gt 0 ]; then +if [ -n "$7" ] && [ "$7" -gt 0 ]; then echo "post-processing failed, bypassing script" exit 1 fi @@ -16,7 +17,7 @@ fi # process files echo "--------------------------" printf %b "$(date)\n" -echo "Starting beets.sh for $(basename $1)" +echo "Starting beets.sh for $(basename "$1")" BEETSDIR=/config export BEETSDIR diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config deleted file mode 100644 index 472eeda..0000000 --- a/root/etc/cont-init.d/30-config +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/with-contenv bash - -# copy config -[[ ! -e /config/beets.sh ]] && \ - cp /defaults/beets.sh /config/beets.sh -[[ ! -e /config/config.yaml ]] && \ - cp /defaults/config.yaml /config/config.yaml - -# permissions -chown -R abc:abc \ - /config diff --git a/root/etc/s6-overlay/s6-rc.d/init-beets-config/dependencies.d/init-config b/root/etc/s6-overlay/s6-rc.d/init-beets-config/dependencies.d/init-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-beets-config/run b/root/etc/s6-overlay/s6-rc.d/init-beets-config/run new file mode 100755 index 0000000..423429d --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-beets-config/run @@ -0,0 +1,10 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +# copy config +cp -n /defaults/beets.sh /config/beets.sh +cp -n /defaults/config.yaml /config/config.yaml + +# permissions +lsiown -R abc:abc \ + /config diff --git a/root/etc/s6-overlay/s6-rc.d/init-beets-config/type b/root/etc/s6-overlay/s6-rc.d/init-beets-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-beets-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-beets-config/up b/root/etc/s6-overlay/s6-rc.d/init-beets-config/up new file mode 100644 index 0000000..4f5e303 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-beets-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-beets-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-beets/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-beets/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-beets/notification-fd b/root/etc/s6-overlay/s6-rc.d/svc-beets/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-beets/notification-fd @@ -0,0 +1 @@ +3 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-beets/run b/root/etc/s6-overlay/s6-rc.d/svc-beets/run new file mode 100755 index 0000000..4c74a20 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-beets/run @@ -0,0 +1,6 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +exec \ + s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8337" \ + s6-setuidgid abc beet web diff --git a/root/etc/s6-overlay/s6-rc.d/svc-beets/type b/root/etc/s6-overlay/s6-rc.d/svc-beets/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-beets/type @@ -0,0 +1 @@ +longrun diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-beets-config b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-beets-config new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-beets b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-beets new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/services.d/beets/run b/root/etc/services.d/beets/run deleted file mode 100644 index 28bb1ab..0000000 --- a/root/etc/services.d/beets/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bash -umask 022 - -exec \ - s6-setuidgid abc beet web