From efcf87b98de00f94ad718ddc5094a7b27ad9ad44 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 30 Jul 2019 22:16:39 +0100 Subject: [PATCH 1/8] Update to Plex 1.16.3.1402 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fd2e80c..3767fcb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG PLEX_VER=1.16.2.1321-ad17d5f9e -ARG PLEX_SHA=1a7e7f7761f977a81dd5a69a83ebc9ebe6f77901 +ARG PLEX_VER=1.16.3.1402-22929c8a2 +ARG PLEX_SHA=58676283202f1f380c9911f8013ab8ab917a1fa0 ARG LIBGCC1_VER=8.3.0-6 ARG XMLSTAR_VER=1.6.1 ARG CURL_VER=curl-7_65_1 From bceaf97cabb8a06b838314b92c862dff8397a6cd Mon Sep 17 00:00:00 2001 From: Adam Dodman Date: Wed, 14 Aug 2019 22:31:17 +0100 Subject: [PATCH 2/8] Update to Plex ver 1.16.4.1469-6d5612c2f --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3767fcb..d746c91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG PLEX_VER=1.16.3.1402-22929c8a2 -ARG PLEX_SHA=58676283202f1f380c9911f8013ab8ab917a1fa0 +ARG PLEX_VER=1.16.4.1469-6d5612c2f +ARG PLEX_SHA=0fa37565e74560debeaad2659a8c308e8825abe2 ARG LIBGCC1_VER=8.3.0-6 ARG XMLSTAR_VER=1.6.1 ARG CURL_VER=curl-7_65_1 From 2cf61498879f0f7f7103b9d2c88c8fed4fcfb57c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 18 Aug 2019 20:02:36 +0100 Subject: [PATCH 3/8] Copy libgcc_1.so from debian-builder --- Dockerfile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index d746c91..45564f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ ARG PLEX_VER=1.16.4.1469-6d5612c2f ARG PLEX_SHA=0fa37565e74560debeaad2659a8c308e8825abe2 -ARG LIBGCC1_VER=8.3.0-6 ARG XMLSTAR_VER=1.6.1 ARG CURL_VER=curl-7_65_1 ARG ZLIB_VER=1.2.11 @@ -10,7 +9,6 @@ FROM spritsail/debian-builder:buster-slim as builder ARG PLEX_VER ARG PLEX_SHA -ARG LIBGCC1_VER ARG LIBXML2_VER=v2.9.8 ARG LIBXSLT_VER=v1.1.32 ARG XMLSTAR_VER @@ -120,9 +118,7 @@ RUN git clone https://github.com/curl/curl.git --branch $CURL_VER --depth 1 . \ WORKDIR /prefix # Fetch Plex and required libraries -RUN curl -fsSL http://ftp.de.debian.org/debian/pool/main/g/gcc-${LIBGCC1_VER:0:1}/libgcc1_${LIBGCC1_VER}_amd64.deb | dpkg-deb -x - . \ - && curl -fsSL -o plexmediaserver.deb https://downloads.plex.tv/plex-media-server-new/${PLEX_VER}/debian/plexmediaserver_${PLEX_VER}_amd64.deb \ - \ +RUN curl -fsSL -o plexmediaserver.deb https://downloads.plex.tv/plex-media-server-new/${PLEX_VER}/debian/plexmediaserver_${PLEX_VER}_amd64.deb \ && echo "$PLEX_SHA plexmediaserver.deb" | sha1sum -c - \ && dpkg-deb -x plexmediaserver.deb . \ \ @@ -138,7 +134,8 @@ RUN curl -fsSL http://ftp.de.debian.org/debian/pool/main/g/gcc-${LIBGCC1_VER:0:1 lib/libz.so* \ Resources/start.sh \ # Place shared libraries in usr/lib so they can be actually shared - && mv lib/* ../ + && mv lib/* ../ \ + && cp /lib/x86_64-linux-gnu/libgcc_s.so.1 lib/ # Strip all unneeded symbols for optimum size RUN find -exec sh -c 'file "{}" | grep -q ELF && strip --strip-debug "{}"' \; \ @@ -165,8 +162,6 @@ RUN chmod +x /output/usr/local/bin/* FROM spritsail/libressl:$LIBRE_VER ARG PLEX_VER -ARG LIBSTDCPP_VER -ARG LIBGCC1_VER ARG CURL_VER ARG XMLSTAR_VER @@ -178,8 +173,6 @@ LABEL maintainer="Spritsail " \ org.label-schema.version=${PLEX_VER} \ io.spritsail.version.plex=${PLEX_VER} \ io.spritsail.version.curl=${CURL_VER} \ - io.spritsail.version.libgcc1=${LIBGCC1_VER} \ - io.spritsail.version.libstdcpp=${LIBSTDCPP_VER} \ io.spritsail.version.xmlstarlet=${XMLSTAR_VER} WORKDIR /usr/lib/plexmediaserver From 878dc6c1e7a688aab565c5897c63f643a601a739 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 23 Aug 2019 21:54:46 +0100 Subject: [PATCH 4/8] Bump libxml2 and libxslt to fix compilation error --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 45564f7..3f59966 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ FROM spritsail/debian-builder:buster-slim as builder ARG PLEX_VER ARG PLEX_SHA -ARG LIBXML2_VER=v2.9.8 -ARG LIBXSLT_VER=v1.1.32 +ARG LIBXML2_VER=v2.9.9 +ARG LIBXSLT_VER=v1.1.33 ARG XMLSTAR_VER ARG LIBRE_VER ARG CURL_VER From 0cd9b2d3a50ac01761aaa74aab5acbbd8141e2d3 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 23 Aug 2019 21:56:13 +0100 Subject: [PATCH 5/8] Download Plex first, to catch failing builds sooner --- Dockerfile | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f59966..a0857a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,28 @@ ARG LIBRE_VER ARG CURL_VER ARG ZLIB_VER +WORKDIR /prefix + +# Fetch Plex and required libraries +RUN curl -fsSL -o plexmediaserver.deb https://downloads.plex.tv/plex-media-server-new/${PLEX_VER}/debian/plexmediaserver_${PLEX_VER}_amd64.deb \ + && echo "$PLEX_SHA plexmediaserver.deb" | sha1sum -c - \ + && dpkg-deb -x plexmediaserver.deb . \ + \ + && cd usr/lib/plexmediaserver \ + && rm -f \ + "Plex Media Server Tests" \ + MigratePlexServerConfig.sh \ + lib/libcrypto.so* \ + lib/libcurl.so* \ + lib/libssl.so* \ + lib/libxml2.so* \ + lib/libxslt.so* \ + lib/libz.so* \ + Resources/start.sh \ + # Place shared libraries in usr/lib so they can be actually shared + && mv lib/* ../ \ + && cp /lib/x86_64-linux-gnu/libgcc_s.so.1 lib/ + # Download and build zlib WORKDIR /tmp/zlib RUN curl -sSf https://www.zlib.net/zlib-$ZLIB_VER.tar.xz \ @@ -117,26 +139,6 @@ RUN git clone https://github.com/curl/curl.git --branch $CURL_VER --depth 1 . \ WORKDIR /prefix -# Fetch Plex and required libraries -RUN curl -fsSL -o plexmediaserver.deb https://downloads.plex.tv/plex-media-server-new/${PLEX_VER}/debian/plexmediaserver_${PLEX_VER}_amd64.deb \ - && echo "$PLEX_SHA plexmediaserver.deb" | sha1sum -c - \ - && dpkg-deb -x plexmediaserver.deb . \ - \ - && cd usr/lib/plexmediaserver \ - && rm -f \ - "Plex Media Server Tests" \ - MigratePlexServerConfig.sh \ - lib/libcrypto.so* \ - lib/libcurl.so* \ - lib/libssl.so* \ - lib/libxml2.so* \ - lib/libxslt.so* \ - lib/libz.so* \ - Resources/start.sh \ - # Place shared libraries in usr/lib so they can be actually shared - && mv lib/* ../ \ - && cp /lib/x86_64-linux-gnu/libgcc_s.so.1 lib/ - # Strip all unneeded symbols for optimum size RUN find -exec sh -c 'file "{}" | grep -q ELF && strip --strip-debug "{}"' \; \ # Disable executable stack in all libraries. This should already be the case From a6fd98cb210cac49301c70db6ce21870789f1882 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 23 Aug 2019 22:07:45 +0100 Subject: [PATCH 6/8] Update .drone.yml to 1.x --- .drone.yml | 87 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/.drone.yml b/.drone.yml index 797616a..2fdab7a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,41 +1,76 @@ -pipeline: - build: - image: spritsail/docker-build - volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ] - repo: plex-dev - make: true +--- +kind: pipeline +name: build-amd64 - test-bin: - image: spritsail/docker-test - volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ] +platform: + os: linux + arch: amd64 + +steps: +- name: build + pull: always + image: spritsail/docker-build + settings: + make: true + repo: plex-dev + +- name: test-bin + pull: always + image: spritsail/docker-test + settings: repo: plex-dev run: | curl --version && xmlstarlet --version - test: - image: spritsail/docker-test - volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ] - repo: plex-dev - curl: ':32400/identity' +- name: test + pull: always + image: spritsail/docker-test + settings: + curl: :32400/identity delay: 5 - retry: 10 pipe: | xmlstarlet sel -t -v "/MediaContainer/@version" | grep -qw "$(label io.spritsail.version.plex | cut -d- -f1)" + repo: plex-dev + retry: 10 - publish: - image: spritsail/docker-publish - volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ] - secrets: [ docker_username, docker_password, microbadger_token ] - when: { branch: [ master ], event: [ push, tag, deployment ] } +- name: publish + pull: always + image: spritsail/docker-publish + settings: from: plex-dev repo: spritsail/plex-media-server tags: - - 'latest' - - '%label io.spritsail.version.plex | %remsuf [0-9a-f]+$ | %auto 2' + - latest + - "%label io.spritsail.version.plex | %remsuf [0-9a-f]+$ | %auto 2" + environment: + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + when: + branch: + - master + event: + - push + - tag - notify: - image: spritsail/notify - when: { status: [ success, failure ] } - secrets: [ webhook_url, notify_token ] +- name: notify + pull: always + image: spritsail/notify + environment: + NOTIFY_TOKEN: + from_secret: notify_token + WEBHOOK_URL: + from_secret: webhook_url + when: + status: + - success + - failure + +--- +kind: signature +hmac: c1c9e7fe83806aba030d7395e11d9077863538131d04c8c291600fe8c84b99bc + +... From 7b6372871f8f04f812c687352182523b03d9299f Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Fri, 23 Aug 2019 21:56:53 +0100 Subject: [PATCH 7/8] Update to Plex 1.16.5.1488 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a0857a1..a98ad49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG PLEX_VER=1.16.4.1469-6d5612c2f -ARG PLEX_SHA=0fa37565e74560debeaad2659a8c308e8825abe2 +ARG PLEX_VER=1.16.5.1488-deeb86e7f +ARG PLEX_SHA=e46c4db05ef9402447246e92e3f5ed808eb11389 ARG XMLSTAR_VER=1.6.1 ARG CURL_VER=curl-7_65_1 ARG ZLIB_VER=1.2.11 From a26c13ae919b6a2bef2ea17ec7318c4414f49a4c Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 24 Aug 2019 14:17:18 +0100 Subject: [PATCH 8/8] Fix build & general cleanup --- Dockerfile | 59 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index a98ad49..bc357c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,27 +16,32 @@ ARG LIBRE_VER ARG CURL_VER ARG ZLIB_VER -WORKDIR /prefix +ARG PREFIX=/prefix + +WORKDIR /plex # Fetch Plex and required libraries RUN curl -fsSL -o plexmediaserver.deb https://downloads.plex.tv/plex-media-server-new/${PLEX_VER}/debian/plexmediaserver_${PLEX_VER}_amd64.deb \ && echo "$PLEX_SHA plexmediaserver.deb" | sha1sum -c - \ && dpkg-deb -x plexmediaserver.deb . \ \ + && rm -r \ + etc/ lib/ usr/sbin/ usr/share/ \ + plexmediaserver.deb \ + \ && cd usr/lib/plexmediaserver \ - && rm -f \ - "Plex Media Server Tests" \ - MigratePlexServerConfig.sh \ + && rm \ lib/libcrypto.so* \ lib/libcurl.so* \ lib/libssl.so* \ lib/libxml2.so* \ lib/libxslt.so* \ - lib/libz.so* \ + lib/libexslt.so* \ Resources/start.sh \ # Place shared libraries in usr/lib so they can be actually shared - && mv lib/* ../ \ - && cp /lib/x86_64-linux-gnu/libgcc_s.so.1 lib/ + && mv lib/*.so* lib/dri ../ \ + && rmdir lib \ + && cp /lib/x86_64-linux-gnu/libgcc_s.so.1 ../ # Download and build zlib WORKDIR /tmp/zlib @@ -45,14 +50,14 @@ RUN curl -sSf https://www.zlib.net/zlib-$ZLIB_VER.tar.xz \ && ./configure \ --prefix=/usr \ --shared \ - && make DESTDIR=/prefix install + && make DESTDIR=$PREFIX install # Download and build libxml2 WORKDIR /tmp/libxml2 RUN git clone https://gitlab.gnome.org/GNOME/libxml2.git --branch $LIBXML2_VER --depth 1 . \ && ./autogen.sh \ --prefix=/usr \ - --with-zlib=/prefix/usr \ + --with-zlib=$PREFIX/usr \ --without-catalog \ --without-docbook \ --without-ftp \ @@ -62,19 +67,18 @@ RUN git clone https://gitlab.gnome.org/GNOME/libxml2.git --branch $LIBXML2_VER - --without-legacy \ --without-modules \ --without-python \ - && make DESTDIR=/prefix install + && make DESTDIR=$PREFIX install # Download and build libxslt WORKDIR /tmp/libxslt RUN git clone https://gitlab.gnome.org/GNOME/libxslt.git --branch $LIBXSLT_VER --depth 1 . \ && ./autogen.sh \ --prefix=/usr \ - --with-zlib=/prefix/usr \ --with-libxml-src="../libxml2" \ --without-crypto \ --without-plugins \ --without-python \ - && make DESTDIR=/prefix install + && make DESTDIR=$PREFIX install # Download and build xmlstarlet ADD xmlstarlet-*.patch /tmp @@ -85,9 +89,9 @@ RUN git clone git://git.code.sf.net/p/xmlstar/code --branch $XMLSTAR_VER --depth && ./configure \ --prefix=/usr \ --disable-build-docs \ - --with-libxml-prefix=/prefix/usr \ - --with-libxslt-prefix=/prefix/usr \ - && make DESTDIR=/prefix install + --with-libxml-prefix=$PREFIX/usr \ + --with-libxslt-prefix=$PREFIX/usr \ + && make DESTDIR=$PREFIX install # Download and build LibreSSL as a cURL dependency WORKDIR /tmp/libressl @@ -109,7 +113,7 @@ RUN git clone https://github.com/curl/curl.git --branch $CURL_VER --depth 1 . \ --enable-versioned-symbols \ --enable-threaded-resolver \ --with-ssl \ - --with-zlib=/prefix/usr \ + --with-zlib=$PREFIX/usr \ --disable-crypto-auth \ --disable-curldebug \ --disable-dependency-tracking \ @@ -135,25 +139,24 @@ RUN git clone https://github.com/curl/curl.git --branch $CURL_VER --depth 1 . \ --without-libpsl \ --without-librtmp \ --without-winidn \ - && make DESTDIR=/prefix install + && make DESTDIR=$PREFIX install -WORKDIR /prefix +WORKDIR $PREFIX + +RUN mkdir -p /output/usr/lib /output/usr/bin \ + && mv usr/lib/*.so* \ + /plex/usr/lib/* \ + /output/usr/lib \ + && mv usr/bin/curl /output/usr/bin \ + && mv usr/bin/xml /output/usr/bin/xmlstarlet # Strip all unneeded symbols for optimum size -RUN find -exec sh -c 'file "{}" | grep -q ELF && strip --strip-debug "{}"' \; \ +RUN find /output -exec sh -c 'file "{}" | grep -q ELF && strip --strip-debug "{}"' \; \ # Disable executable stack in all libraries. This should already be the case # but it seems libgnsdk is not playing along && apt-get -y update \ && apt-get -y install execstack \ - && execstack -c usr/lib/*.so* \ - \ - && mkdir -p /output/usr/lib /output/usr/bin \ - && mv lib/x86_64-linux-gnu/*.so* \ - usr/lib/plexmediaserver \ - usr/lib/*.so* \ - /output/usr/lib \ - && mv usr/bin/curl /output/usr/bin \ - && mv usr/bin/xml /output/usr/bin/xmlstarlet + && execstack -c /output/usr/lib/*.so* ADD entrypoint /output/usr/local/bin/ ADD *.sh /output/usr/local/bin/