From 998c6f61466e790c1a6df0837468ab87464b562f Mon Sep 17 00:00:00 2001 From: shnee Date: Mon, 14 Jan 2019 14:03:04 -0500 Subject: [PATCH] Removed linuxserver.io's extras. - Removed linuxserver.io's extras: + Build from regular alpine instead of their base image. + Removed their config, scripts, init stuff. - Currently runs. --- Dockerfile | 195 ++++++++++++++++++--------------- beets-docker.sh | 12 ++ root/defaults/beets.sh | 26 ----- root/defaults/config.yaml | 63 ----------- root/etc/cont-init.d/30-config | 11 -- root/etc/services.d/beets/run | 5 - 6 files changed, 118 insertions(+), 194 deletions(-) create mode 100755 beets-docker.sh delete mode 100644 root/defaults/beets.sh delete mode 100644 root/defaults/config.yaml delete mode 100644 root/etc/cont-init.d/30-config delete mode 100644 root/etc/services.d/beets/run diff --git a/Dockerfile b/Dockerfile index ecab755..0547d14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,96 +1,113 @@ -FROM lsiobase/alpine:3.8 - -# set version label -ARG BUILD_DATE -ARG VERSION -LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="sparklyballs" +FROM alpine:3.8 RUN \ - echo "**** install build packages ****" && \ - apk add --no-cache --virtual=build-dependencies \ - cmake \ - ffmpeg-dev \ - g++ \ - gcc \ - git \ - jpeg-dev \ - libpng-dev \ - make \ - mpg123-dev \ - openjpeg-dev \ - python2-dev && \ - echo "**** install runtime packages ****" && \ - apk add --no-cache \ - curl \ - expat \ - ffmpeg \ - ffmpeg-libs \ - gdbm \ - gst-plugins-good \ - gstreamer \ - jpeg \ - lame \ - libffi \ - libpng \ - mpg123 \ - nano \ - openjpeg \ - py2-gobject3 \ - py2-pip \ - py2-pylast \ - python2 \ - sqlite-libs \ - tar \ - wget && \ - echo "**** compile mp3gain ****" && \ - mkdir -p \ - /tmp/mp3gain-src && \ - curl -o \ - /tmp/mp3gain-src/mp3gain.zip -L \ - https://sourceforge.net/projects/mp3gain/files/mp3gain/1.6.1/mp3gain-1_6_1-src.zip && \ - cd /tmp/mp3gain-src && \ - unzip -qq /tmp/mp3gain-src/mp3gain.zip && \ - sed -i "s#/usr/local/bin#/usr/bin#g" /tmp/mp3gain-src/Makefile && \ - make && \ - make install && \ - echo "**** compile chromaprint ****" && \ - git clone https://bitbucket.org/acoustid/chromaprint.git \ - /tmp/chromaprint && \ - cd /tmp/chromaprint && \ - cmake \ - -DBUILD_TOOLS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr && \ - make && \ - make install && \ - echo "**** install pip packages ****" && \ - pip install --no-cache-dir -U \ - beautifulsoup4 \ - beets \ - beets-copyartifacts \ - discogs-client \ - flask \ - pillow \ - pip \ - pyacoustid \ - requests \ - unidecode && \ - echo "**** cleanup ****" && \ - apk del --purge \ - build-dependencies && \ - rm -rf \ - /root/.cache \ - /tmp/* + echo -e "\n" \ +"**************************************************************************" \ +"\n * Install build packages.\n" \ +"**************************************************************************\n" \ + && \ + apk add --no-cache --virtual=build-dependencies \ + cmake \ + ffmpeg-dev \ + g++ \ + gcc \ + git \ + jpeg-dev \ + libpng-dev \ + make \ + mpg123-dev \ + openjpeg-dev \ + python2-dev \ + && \ + echo -e "\n" \ +"**************************************************************************" \ +"\n * Install runtime packages.\n" \ +"**************************************************************************\n" \ + && \ + apk add --no-cache \ + curl \ + expat \ + ffmpeg \ + ffmpeg-libs \ + gdbm \ + gst-plugins-good \ + gstreamer \ + jpeg \ + lame \ + libffi \ + libpng \ + mpg123 \ + openjpeg \ + py2-gobject3 \ + py2-pip \ + py2-pylast \ + python2 \ + sqlite-libs \ + tar \ + vim \ + wget && \ + echo -e "\n" \ +"**************************************************************************" \ +"\n * Compile mp3gain.\n" \ +"**************************************************************************\n" \ + && \ + mkdir -p \ + /tmp/mp3gain-src && \ + curl -o \ + /tmp/mp3gain-src/mp3gain.zip -L \ + https://sourceforge.net/projects/mp3gain/files/mp3gain/1.6.1/mp3gain-1_6_1-src.zip && \ + cd /tmp/mp3gain-src && \ + unzip -qq /tmp/mp3gain-src/mp3gain.zip && \ + sed -i "s#/usr/local/bin#/usr/bin#g" /tmp/mp3gain-src/Makefile && \ + make && \ + make install && \ + echo -e "\n" \ +"**************************************************************************" \ +"\n * Compile chromaprint.\n" \ +"**************************************************************************\n" \ + && \ + git clone https://bitbucket.org/acoustid/chromaprint.git \ + /tmp/chromaprint && \ + cd /tmp/chromaprint && \ + cmake \ + -DBUILD_TOOLS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr && \ + make && \ + make install && \ + echo -e "\n" \ +"**************************************************************************" \ +"\n * Install pip packages.\n" \ +"**************************************************************************\n" \ + && \ + pip install --no-cache-dir -U \ + beautifulsoup4 \ + beets \ + beets-copyartifacts \ + discogs-client \ + flask \ + pillow \ + pip \ + pyacoustid \ + requests \ + unidecode && \ + echo -e "\n" \ +"**************************************************************************" \ +"\n * Cleanup.\n" \ +"**************************************************************************\n" \ + && \ + apk del --purge \ + build-dependencies && \ + rm -rf \ + /root/.cache \ + /tmp/* # environment settings ENV BEETSDIR="/config" \ -EDITOR="nano" \ -HOME="/config" + EDITOR="vim" \ + HOME="/config" + +VOLUME /config /downloads /music /staging -# copy local files -COPY root/ / +ENTRYPOINT ["/usr/bin/beet"] -# ports and volumes -EXPOSE 8337 -VOLUME /config /downloads /music diff --git a/beets-docker.sh b/beets-docker.sh new file mode 100755 index 0000000..ee3ad45 --- /dev/null +++ b/beets-docker.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +BEETS_DOCKER_DATA="/home/gert/projects/beets-docker-data" + +docker run \ + --name beets \ + --rm \ + -ti \ + --user $(id -u):$(id -g) \ + -v $BEETS_DOCKER_DATA:/config \ + beets:latest $@ + diff --git a/root/defaults/beets.sh b/root/defaults/beets.sh deleted file mode 100644 index 5ab4b8c..0000000 --- a/root/defaults/beets.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# beets music tagger - post-processing script -# -# Author: Rich Manton (overbyrn) -# Date: 29-04-13 -# -# $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 - echo "post-processing failed, bypassing script" - exit 1 -fi - -# process files -echo "--------------------------" -printf %b "$(date)\n" -echo "Starting beets.sh for $(basename $1)" - -BEETSDIR=/config -export BEETSDIR -FPCALC=/usr/bin/fpcalc -export FPCALC -/usr/local/bin/beet -v import -q "$1" - diff --git a/root/defaults/config.yaml b/root/defaults/config.yaml deleted file mode 100644 index 64c6f6c..0000000 --- a/root/defaults/config.yaml +++ /dev/null @@ -1,63 +0,0 @@ -plugins: fetchart embedart convert scrub replaygain lastgenre chroma web -directory: /music -library: /config/musiclibrary.blb -art_filename: albumart -threaded: yes -original_date: no -per_disc_numbering: no - -convert: - auto: no - ffmpeg: /usr/bin/ffmpeg - opts: -ab 320k -ac 2 -ar 48000 - max_bitrate: 320 - threads: 1 - -paths: - default: $albumartist/$album%aunique{}/$track - $title - singleton: Non-Album/$artist - $title - comp: Compilations/$album%aunique{}/$track - $title - albumtype_soundtrack: Soundtracks/$album/$track $title - -import: - write: yes - copy: no - move: yes - resume: ask - incremental: yes - quiet_fallback: skip - timid: no - log: /config/beet.log - -lastgenre: - auto: yes - source: album - -embedart: - auto: yes - -fetchart: - auto: yes - -replaygain: - auto: no - -scrub: - auto: yes - -replace: - '^\.': _ - '[\x00-\x1f]': _ - '[<>:"\?\*\|]': _ - '[\xE8-\xEB]': e - '[\xEC-\xEF]': i - '[\xE2-\xE6]': a - '[\xF2-\xF6]': o - '[\xF8]': o - '\.$': _ - '\s+$': '' - -web: - host: 0.0.0.0 - port: 8337 - 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/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