2016-09-08 22:59:52 +00:00
|
|
|
FROM adamant/alpine-glibc
|
2016-08-26 21:26:39 +00:00
|
|
|
MAINTAINER Adam Dodman <adam.dodman@gmx.com>
|
|
|
|
|
2016-09-08 22:59:52 +00:00
|
|
|
ENV UID=787 UNAME=plex GID=990 GNAME=media
|
2016-08-26 21:26:39 +00:00
|
|
|
ADD start_pms.patch /tmp/start_pms.patch
|
|
|
|
|
|
|
|
WORKDIR /tmp
|
|
|
|
|
|
|
|
RUN addgroup -g $GID $GNAME \
|
|
|
|
&& adduser -SH -u $UID -G $GNAME -s /usr/sbin/nologin $UNAME \
|
|
|
|
|
|
|
|
&& apk add --no-cache xz binutils patchelf openssl file \
|
|
|
|
|
|
|
|
&& wget -O plexmediaserver.deb 'https://plex.tv/downloads/latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu' \
|
|
|
|
|
2016-09-08 22:59:52 +00:00
|
|
|
&& ar x plexmediaserver.deb \
|
|
|
|
&& tar -xf data.tar.* \
|
2016-08-26 21:26:39 +00:00
|
|
|
|
2016-09-08 22:59:52 +00:00
|
|
|
&& find usr/lib/plexmediaserver -type f -perm /0111 -exec sh -c "file --brief \"{}\" | grep -q "ELF" && patchelf --set-interpreter \"$GLIBC_LD_LINUX_SO\" \"{}\" " \; \
|
2016-08-26 21:26:39 +00:00
|
|
|
|
2016-09-08 22:59:52 +00:00
|
|
|
&& mv /tmp/start_pms.patch usr/sbin/ \
|
|
|
|
&& cd usr/sbin/ \
|
2016-08-26 21:26:39 +00:00
|
|
|
&& patch < start_pms.patch \
|
|
|
|
&& cd /tmp \
|
2016-09-08 22:59:52 +00:00
|
|
|
&& sed -i "s|<destdir>|$DESTDIR|" usr/sbin/start_pms \
|
2016-08-26 21:26:39 +00:00
|
|
|
|
2016-09-08 22:59:52 +00:00
|
|
|
&& mv usr/sbin/start_pms $DESTDIR/ \
|
|
|
|
&& mv usr/lib/plexmediaserver $DESTDIR/plex-media-server \
|
2016-08-26 21:26:39 +00:00
|
|
|
|
|
|
|
&& apk del --no-cache xz binutils patchelf file \
|
|
|
|
&& rm -rf /tmp/*
|
|
|
|
|
|
|
|
|
2016-08-26 21:33:54 +00:00
|
|
|
USER plex
|
2016-08-26 21:26:39 +00:00
|
|
|
|
2016-09-08 22:59:52 +00:00
|
|
|
WORKDIR /glibc
|
2016-08-26 21:26:39 +00:00
|
|
|
|
2016-09-08 22:59:52 +00:00
|
|
|
CMD ["/glibc/start_pms"]
|