Skip to content

Commit bac8b14

Browse files
committed
use plex env variables, usermod home folder of abc to /app
1 parent 88c81df commit bac8b14

4 files changed

Lines changed: 24 additions & 12 deletions

File tree

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ MAINTAINER Stian Larsen, sparklyballs
55
ENV PLEX_INSTALL="https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu"
66

77
# global environment settings
8-
ENV DEBIAN_FRONTEND="noninteractive"
9-
ENV HOME="/config"
10-
ENV PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server"
8+
ENV DEBIAN_FRONTEND="noninteractive" \
9+
PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server" \
10+
PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support" \
11+
PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver" \
12+
PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS="6"
1113

1214
# install packages
1315
RUN \
@@ -23,6 +25,9 @@ RUN \
2325
"${PLEX_INSTALL}" && \
2426
dpkg -i /tmp/plexmediaserver.deb && \
2527

28+
# change abc home folder to fix plex hanging at runtime with usermod
29+
usermod -d /app abc && \
30+
2631
# cleanup
2732
apt-get clean && \
2833
rm -rf \

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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.
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#!/usr/bin/with-contenv bash
22

33
# 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 \
11-
/config/Library
4+
if [ ! -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" ]; then
5+
mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
6+
chown abc:abc "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
7+
elif [ ! "$(stat -c %u ${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR})" = "$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 \
11+
"${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
1212
fi
13+
14+
chown abc:abc \
15+
/config \
16+
/config/*

root/etc/services.d/plex/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/with-contenv bash
22

33
echo "Starting Plex Media Server."
4-
exec s6-setuidgid abc /usr/sbin/start_pms
4+
exec s6-setuidgid abc /bin/sh -c 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver /usr/lib/plexmediaserver/Plex\ Media\ Server'
5+
56

0 commit comments

Comments
 (0)