use plex env variables, usermod home folder of abc to /app

This commit is contained in:
sparklyballs 2017-01-11 19:16:55 +00:00
parent 88c81df5ae
commit bac8b14e6c
4 changed files with 24 additions and 12 deletions

View file

@ -5,9 +5,11 @@ MAINTAINER Stian Larsen, sparklyballs
ENV PLEX_INSTALL="https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu" ENV PLEX_INSTALL="https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu"
# global environment settings # global environment settings
ENV DEBIAN_FRONTEND="noninteractive" ENV DEBIAN_FRONTEND="noninteractive" \
ENV HOME="/config" PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server" \
ENV PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server" PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support" \
PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver" \
PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS="6"
# install packages # install packages
RUN \ RUN \
@ -23,6 +25,9 @@ RUN \
"${PLEX_INSTALL}" && \ "${PLEX_INSTALL}" && \
dpkg -i /tmp/plexmediaserver.deb && \ dpkg -i /tmp/plexmediaserver.deb && \
# change abc home folder to fix plex hanging at runtime with usermod
usermod -d /app abc && \
# cleanup # cleanup
apt-get clean && \ apt-get clean && \
rm -rf \ rm -rf \

View file

@ -100,6 +100,8 @@ Valid settings for VERSION are:-
## Versions ## Versions
+ **11.01.17:** Use Plex environemt variables from pms docker,
change abc home folder to /app to alleviate usermod chowning library folder by default (thanks gbooker, plexinc).
+ **03.01.17:** Use case insensitive version variable matching rather than export and make lowercase. + **03.01.17:** Use case insensitive version variable matching rather than export and make lowercase.
+ **17.10.16:** Allow use of uppercase version variable + **17.10.16:** Allow use of uppercase version variable
+ **01.10.16:** Add TZ info to README. + **01.10.16:** Add TZ info to README.

View file

@ -1,12 +1,16 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
# check for Library existence and permissions # check for Library existence and permissions
if [ ! -d "/config/Library" ]; then if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then
mkdir -p /config/Library mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
chown abc:abc /config/Library chown abc:abc "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
elif [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then elif [ ! "$(stat -c %u ${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR})" = "$PUID" ]; then
echo "Change in ownership detected, please be patient while we chown existing files" echo "Change in ownership detected, please be patient while we chown existing files"
echo "This could take some time" echo "This could take some time"
chown abc:abc -R \ chown abc:abc -R \
/config/Library "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
fi fi
chown abc:abc \
/config \
/config/*

View file

@ -1,5 +1,6 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
echo "Starting Plex Media Server." echo "Starting Plex Media Server."
exec s6-setuidgid abc /usr/sbin/start_pms exec s6-setuidgid abc /bin/sh -c 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver /usr/lib/plexmediaserver/Plex\ Media\ Server'