From 0e1f228d6b8cc44bbafcb30a66b9f56c9ba685f1 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Sun, 25 Sep 2016 09:02:39 +0100 Subject: [PATCH] alpine rebase --- Dockerfile | 108 ++++++++++++++++++------ README.md | 8 +- init/30_update.sh | 10 --- init/40_set_config.sh | 7 -- {defaults => root/defaults}/beets.sh | 0 {defaults => root/defaults}/config.yaml | 0 root/etc/cont-init.d/30-config | 11 +++ root/etc/services.d/beets/run | 5 ++ services/beets/run | 4 - sources.list | 34 -------- 10 files changed, 99 insertions(+), 88 deletions(-) delete mode 100644 init/30_update.sh delete mode 100644 init/40_set_config.sh rename {defaults => root/defaults}/beets.sh (100%) rename {defaults => root/defaults}/config.yaml (100%) create mode 100644 root/etc/cont-init.d/30-config create mode 100644 root/etc/services.d/beets/run delete mode 100644 services/beets/run delete mode 100644 sources.list diff --git a/Dockerfile b/Dockerfile index d7a73db..844bb72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,81 @@ -FROM linuxserver/baseimage.python -MAINTAINER smdion ,Sparklyballs - -ENV BEETSDIR /config -ENV APTLIST="ffmpeg lame libav-tools libchromaprint-tools libjpeg8-dev libopenjpeg-dev libpng12-dev libyaml-dev mp3gain python2.7" - -# copy sources.list -COPY sources.list /etc/apt/ - -RUN add-apt-repository ppa:fkrull/deadsnakes-python2.7 && \ -add-apt-repository ppa:kirillshkrogalev/ffmpeg-next && \ -apt-get update -q && \ -apt-get install $APTLIST -qy && \ -pip install -U pyacoustid && \ -pip install -U pylast && \ -pip install -U flask && \ -pip install -U pillow && \ -pip install -U beets && \ -apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /root/.cache - -#Adding Custom files -ADD init/ /etc/my_init.d/ -ADD services/ /etc/service/ -ADD defaults/ /defaults/ -RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh - -# Volumes and Ports -VOLUME /config /downloads /music +FROM lsiobase/alpine +MAINTAINER sparklyballs + +# environment settings +ENV BEETSDIR="/config" + +# install runtime packages +RUN \ + apk add --no-cache \ + curl \ + expat \ + ffmpeg \ + ffmpeg-libs \ + gdbm \ + jpeg \ + lame \ + libffi \ + libpng \ + openjpeg \ + py-pip \ + python \ + py-unidecode \ + sqlite-libs \ + wget && \ + +# install build packages + apk add --no-cache --virtual=build-dependencies \ + cmake \ + ffmpeg-dev \ + g++ \ + gcc \ + git \ + jpeg-dev \ + libpng-dev \ + make \ + openjpeg-dev \ + python-dev && \ + +# compile mp3gain + mkdir -p \ + /tmp/mp3gain-src && \ + curl -o \ + /tmp/mp3gain-src/mp3gain.zip -L \ + https://sourceforge.net/projects/mp3gain/files/mp3gain/1.5.2/mp3gain-1_5_2_r2-src.zip && \ + cd /tmp/mp3gain-src && \ + unzip -qq /tmp/mp3gain-src/mp3gain.zip && \ + make && \ + make install && \ + +# compile chromaprint + git clone https://bitbucket.org/acoustid/chromaprint.git \ + /tmp/chromaprint && \ + cd /tmp/chromaprint && \ + cmake \ + -DBUILD_EXAMPLES=ON . \ + -DCMAKE_BUILD_TYPE=Release && \ + make && \ + make install && \ + +# install pip packages + pip install --no-cache-dir -U \ + beets \ + flask \ + pillow \ + pip \ + pyacoustid \ + pylast && \ + +# cleanup + apk del --purge \ + build-dependencies && \ + rm -rf \ + /root/.cache \ + /tmp/* + +# copy local files +COPY root/ / + +# ports and volumes EXPOSE 8337 +VOLUME /config /downloads /music diff --git a/README.md b/README.md index 8c01ad7..4f2992b 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ The [LinuxServer.io][linuxserverurl] team brings you another container release f ``` docker create \ --name=beets \ --v /etc/localtime:/etc/localtime:ro \ -v :/config \ -e PGID= -e PUID= \ -p 1234:1234 \ @@ -34,14 +33,13 @@ linuxserver/beets **Parameters** * `-p 8337` - the port(s) -* `-v /etc/localtime` for timesync - *optional* * `-v /config` - Configuration files * `-v /music` - Music library location * `-v /downloads` - Non-processed music * `-e PGID` for GroupID - see below for explanation * `-e PUID` for UserID - see below for explanation -It is based on phusion-baseimage with ssh removed, for shell access whilst the container is running do `docker exec -it beets /bin/bash`. +It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it beets /bin/bash`. ### User / Group Identifiers @@ -58,14 +56,14 @@ In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as bel Edit the config file in /config -## Updates +## Info -* Upgrade to the latest version simply `docker restart beets`. * To monitor the logs of the container in realtime `docker logs -f beets`. ## Versions ++ **24.09.16:** Rebase to alpine linux. + **10.09.16:** Add layer badges to README. + **05.01.16:** Change ffpmeg repository, other version crashes container + **06.11.15:** Initial Release diff --git a/init/30_update.sh b/init/30_update.sh deleted file mode 100644 index 1a8819a..0000000 --- a/init/30_update.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# opt out for autoupdates -[ "$ADVANCED_DISABLEUPDATES" ] && exit 0 - -pip install -U pyacoustid -pip install -U pylast -pip install -U flask -pip install -U pillow -pip install -U beets diff --git a/init/40_set_config.sh b/init/40_set_config.sh deleted file mode 100644 index 087126f..0000000 --- a/init/40_set_config.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -[[ ! -f /config/beets.sh ]] && cp /defaults/beets.sh /config/beets.sh -[[ ! -f /config/config.yaml ]] && cp /defaults/config.yaml /config/config.yaml - -chown -R abc:abc /config - diff --git a/defaults/beets.sh b/root/defaults/beets.sh similarity index 100% rename from defaults/beets.sh rename to root/defaults/beets.sh diff --git a/defaults/config.yaml b/root/defaults/config.yaml similarity index 100% rename from defaults/config.yaml rename to root/defaults/config.yaml diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config new file mode 100644 index 0000000..472eeda --- /dev/null +++ b/root/etc/cont-init.d/30-config @@ -0,0 +1,11 @@ +#!/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 new file mode 100644 index 0000000..dc66f3e --- /dev/null +++ b/root/etc/services.d/beets/run @@ -0,0 +1,5 @@ +#!/usr/bin/with-contenv bash +umask 002 + +exec \ + s6-setuidgid abc beet web diff --git a/services/beets/run b/services/beets/run deleted file mode 100644 index d35edd2..0000000 --- a/services/beets/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -umask 002 - -/sbin/setuser abc beet web diff --git a/sources.list b/sources.list deleted file mode 100644 index 67e1042..0000000 --- a/sources.list +++ /dev/null @@ -1,34 +0,0 @@ -# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to -# newer versions of the distribution. - -deb http://archive.ubuntu.com/ubuntu/ trusty main restricted -deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted - -## Major bug fix updates produced after the final release of the -## distribution. -deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted -deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted - -## Uncomment the following two lines to add software from the 'universe' -## repository. -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team. Also, please note that software in universe WILL NOT receive any -## review or updates from the Ubuntu security team. -deb http://archive.ubuntu.com/ubuntu/ trusty universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ trusty universe multiverse -deb http://archive.ubuntu.com/ubuntu/ trusty-updates universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates universe multiverse - -## N.B. software from this repository may not have been tested as -## extensively as that contained in the main release, although it includes -## newer versions of some applications which may provide useful features. -## Also, please note that software in backports WILL NOT receive any review -## or updates from the Ubuntu security team. -# deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted -# deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted - -deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted -deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted -deb http://archive.ubuntu.com/ubuntu/ trusty-security universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ trusty-security universe multiverse -