File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11FROM lsiobase/xenial
22MAINTAINER Stian Larsen, sparklyballs
33
4- # package version
5- ENV PLEX_INSTALL="https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu"
64
75# global environment settings
8- ENV DEBIAN_FRONTEND="noninteractive"
9- ENV HOME="/config"
10- ENV PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server"
6+ ENV DEBIAN_FRONTEND="noninteractive" \
7+ PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server" \
8+ PLEX_INSTALL="https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu" \
9+ PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support" \
10+ PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver" \
11+ PLEX_MEDIA_SERVER_INFO_DEVICE=docker \
12+ PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS="6" \
13+ PLEX_MEDIA_SERVER_USER=abc \
14+ LD_LIBRARY_PATH="/usr/lib/plexmediaserver:$LD_LIBRARY_PATH"
1115
1216# install packages
1317RUN \
2327 "${PLEX_INSTALL}" && \
2428 dpkg -i /tmp/plexmediaserver.deb && \
2529
30+ # change abc home folder to fix plex hanging at runtime with usermod
31+ usermod -d /app abc && \
32+
2633# cleanup
2734 apt-get clean && \
2835 rm -rf \
Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ Valid settings for VERSION are:-
100100
101101## Versions
102102
103+ + ** 11.01.17:** Use Plex environemt variables from pms docker,
104+ change abc home folder to /app to alleviate usermod chowning library folder by default (thanks gbooker, plexinc).
103105+ ** 03.01.17:** Use case insensitive version variable matching rather than export and make lowercase.
104106+ ** 17.10.16:** Allow use of uppercase version variable
105107+ ** 01.10.16:** Add TZ info to README.
Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22
3- # check for Library existence and permissions
4- if [ ! -d "/config/Library" ]; then
5- mkdir -p /config/Library
6- chown abc:abc /config/Library
7- elif [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then
8- echo "Change in ownership detected, please be patient while we chown existing files"
9- echo "This could take some time"
10- chown abc:abc -R \
3+ # create folders
4+ if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then \
5+ mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
6+ chown -R abc:abc /config
7+ fi
8+
9+ # check Library permissions
10+ PUID=${PUID:-911}
11+ if [ ! "$(stat -c %u /config/Library)" = "$PUID" ]; then
12+ echo "Change in ownership detected, please be patient while we chown existing files"
13+ echo "This could take some time"
14+ chown abc:abc -R \
1115 /config/Library
1216fi
17+
18+ # permissions (non-recursive) on config root and folders
19+ chown abc:abc \
20+ /config \
21+ /config/*
Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22
3- # copy config on first run, regardless of update status
4- [[ ! -e /etc/default/plexmediaserver ]] && \
5- cp /defaults/plexmediaserver /etc/default/plexmediaserver
6-
73# test if plex is installed and try re-pulling latest if not
84if (dpkg --get-selections plexmediaserver | grep -wq "install"); then
95:
117113dpkg -i --force-confold /tmp/plexmediaserver_"${REMOTE_VERSION}"_amd64.deb
118114rm -f /tmp/plexmediaserver_*.deb
119115fi
120-
121- # recopy config file
122- cp /defaults/plexmediaserver /etc/default/plexmediaserver
Original file line number Diff line number Diff line change 66
77echo "Starting Avahi daemon"
88exec avahi-daemon --no-chroot
9-
Original file line number Diff line number Diff line change 22
33echo "Starting dbus-daemon"
44exec dbus-daemon --system --nofork
5-
Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22
33echo "Starting Plex Media Server."
4- exec s6-setuidgid abc /usr/sbin/start_pms
5-
4+ exec \
5+ s6-setuidgid abc /bin/bash -c \
6+ '/usr/lib/plexmediaserver/Plex\ Media\ Server'
You can’t perform that action at this time.
0 commit comments