diff --git a/Dockerfile b/Dockerfile index 867212f..17d2331 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,9 @@ -FROM linuxserver/baseimage.python -MAINTAINER lonix +FROM lsiobase/alpine.python +MAINTAINER sparklyballs -#Adding Custom files -ADD init/ /etc/my_init.d/ -ADD services/ /etc/service/ -RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh +# add local files +COPY root/ / -# Volumes and Ports +# ports and volumes VOLUME /config /logs EXPOSE 8181 - - - diff --git a/README.md b/README.md index 34bad06..60d9e31 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ ![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) -The [LinuxServer.io](https://linuxserver.io) team brings you another quality container release featuring auto-update on startup, easy user mapping and community support. Be sure to checkout our [forums](https://forum.linuxserver.io) or for real-time support our [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io`. +The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring easy user mapping and community support. Find us for support at: +* [forum.linuxserver.io](https://forum.linuxserver.io) +* [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io` +* [Podcast](https://www.linuxserver.io/index.php/category/podcast/) covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! # linuxserver/plexpy @@ -11,11 +14,10 @@ The [LinuxServer.io](https://linuxserver.io) team brings you another quality con ``` docker create \ --name=plexpy \ - -v /etc/localtime:/etc/localtime:ro \ -v :/config \ -v :/logs:ro \ -e PGID= -e PUID= \ - -e ADVANCED_GIT_BRANCH= \ + -e TZ= \ -p 8181:8181 \ linuxserver/plexpy ``` @@ -23,30 +25,30 @@ docker create \ **Parameters** * `-p 8181` - Port for webui -* `-v /etc/localtime` for timesync - *optional* * `-v /config` Containes plexpy config and database * `-v /logs` Map this to PLex Media servers log directory - bonus points for mapping RO * `-e PGID` for GroupID - see below for explanation * `-e PUID` for UserID - see below for explanation -* `-e ADVANCED_GIT_BRANCH` to choose a specfic branch ( no support on the app if changed ) +* `-e TZ` for setting timezone information, eg Europe/London -It is based on phusion-baseimage with ssh removed, for shell access whilst the container is running do `docker exec -it plexpy /bin/bash`. +It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it plexpy /bin/bash`. ### User / Group Identifiers -**TL;DR** - The `PGID` and `PUID` values set the user / group you'd like your container to 'run as' to the host OS. This can be a user you've created or even root (not recommended). +Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™. -Part of what makes our containers work so well is by allowing you to specify your own `PUID` and `PGID`. This avoids nasty permissions errors with relation to data volumes (`-v` flags). When an application is installed on the host OS it is normally added to the common group called users, Docker apps due to the nature of the technology can't be added to this group. So we added this feature to let you easily choose when running your containers. +In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below: +``` + $ id + uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) +``` +## Info -## Updates - -* Upgrade to the latest version simply `docker restart plexpy`. * To monitor the logs of the container in realtime `docker logs -f plexpy`. - - ## Versions -+ **16.07.2015:** Inital Release ++ **08.08.16:** Rebase to alpine linux. ++ **16.07.15:** Inital Release. diff --git a/init/30_install_update_plexpy.sh b/init/30_install_update_plexpy.sh deleted file mode 100644 index 16f5d22..0000000 --- a/init/30_install_update_plexpy.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -chown -R abc:abc /config - -#If variable $ADVANCED_GIT_BRANCH, set branch to $ADVANCED_GIT_BRANCH, otherwise, default to master -[ "$ADVANCED_GIT_BRANCH" ] && \ -echo "BRANCH: $ADVANCED_GIT_BRANCH, Warning! This is unsupported." || ADVANCED_GIT_BRANCH="master" - -[[ ! -d /opt/plexpy/.git ]] && (echo "Cloning $ADVANCED_GIT_BRANCH branch..." && \ -git clone https://github.com/drzoidberg33/plexpy.git --branch $ADVANCED_GIT_BRANCH /opt/plexpy && \ -chown -R abc:abc /opt/plexpy/) - -# opt out for autoupdates -[ "$ADVANCED_DISABLEUPDATES" ] && exit 0 -cd /opt/plexpy -git pull -chown -R abc:abc /opt/plexpy/ diff --git a/root/etc/cont-init.d/30-install b/root/etc/cont-init.d/30-install new file mode 100644 index 0000000..978d55d --- /dev/null +++ b/root/etc/cont-init.d/30-install @@ -0,0 +1,14 @@ +#!/usr/bin/with-contenv bash + +#If variable $ADVANCED_GIT_BRANCH, set branch to $ADVANCED_GIT_BRANCH, otherwise, default to master +[ "$ADVANCED_GIT_BRANCH" ] && \ + echo "Using this variable is unsupported., THERE IS NO PATH BACK TO MASTER GIT BRANCH OTHER THAN REMOVING EXISTING APPDATA FOLDER, WE MEAN IT WHEN WE SAY UNSUPPORTED" || \ + ADVANCED_GIT_BRANCH="master" + +# install app  +[[ ! -d "/opt/plexpy/.git" ]] && \ + git clone --branch $ADVANCED_GIT_BRANCH https://github.com/drzoidberg33/plexpy.git /opt/plexpy + +# permissions +chown -R abc:abc \ + /opt/plexpy diff --git a/root/etc/services.d/plexpy/run b/root/etc/services.d/plexpy/run new file mode 100644 index 0000000..e5511ce --- /dev/null +++ b/root/etc/services.d/plexpy/run @@ -0,0 +1,5 @@ +#!/usr/bin/with-contenv bash + +exec \ + s6-setuidgid abc python /opt/plexpy/PlexPy.py \ + --datadir /config diff --git a/services/plexpy/run b/services/plexpy/run deleted file mode 100644 index 2e086a2..0000000 --- a/services/plexpy/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -exec /sbin/setuser abc /usr/bin/python /opt/plexpy/PlexPy.py --datadir /config -