From 0e6cb00bdeaa77033741baf51070439109c28279 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 19 Sep 2017 23:44:59 +0100 Subject: [PATCH 1/3] Fix drone test without continuation escapes --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1d7b06a..247e43e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,9 +24,9 @@ pipeline: - CON_NAME=$(docker run --rm -d plex-dev) - sleep 10 # Wait for plex to start! - docker logs $$CON_NAME - - curl -sSL $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $$CON_NAME):32400/identity \ - | tee /dev/stderr \ - | xmlstarlet sel -t -v "/MediaContainer/@version" \ + - curl -sSL $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $$CON_NAME):32400/identity + | tee /dev/stderr + | xmlstarlet sel -t -v "/MediaContainer/@version" | grep -qw $CUR_VERSION - docker kill $$CON_NAME # Not really needed, but keeps things quick From 533a6da6f4e679eff3465ba52a902b03f9a36ff5 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 20 Sep 2017 00:03:03 +0100 Subject: [PATCH 2/3] Pass plex version into container as build-arg --- .drone.yml | 3 +-- Dockerfile | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 247e43e..32ed4d8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,6 @@ pipeline: image: docker commands: # Grab the current version, prevents race conditions - #### Pass this into the Dockerfile somehow? - apk add --no-cache openssl jq - wget -qO- https://adam-ant.co.uk/plex/version.php | tee /dev/stderr | jq -r .release > .plex_version @@ -12,7 +11,7 @@ pipeline: volumes: - /var/run/docker.sock:/var/run/docker.sock commands: - - docker build --no-cache --pull -t plex-dev . + - docker build --no-cache --pull --build-arg PLEX_VER="$(cat .plex_version)" -t plex-dev . test: image: docker diff --git a/Dockerfile b/Dockerfile index 14870b1..ab10a5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ ADD start_pms /usr/sbin/start_pms WORKDIR /tmp +ARG PLEX_VER + RUN wget http://ftp.de.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_amd64.deb \ && wget http://ftp.de.debian.org/debian/pool/main/g/gcc-6/libgcc1_6.3.0-18_amd64.deb \ && dpkg-deb -x libstdc++6*.deb . \ @@ -13,7 +15,9 @@ RUN wget http://ftp.de.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_a # We only need the lib files, everything else is debian junk. && mv /tmp/usr/lib/x86_64-linux-gnu/* /lib \ && mv /tmp/lib/x86_64-linux-gnu/* /lib \ - && export PLEX_VER=$(wget -qO- https://adam-ant.co.uk/plex/version.php | sed -n 's/.*"release":\s*"\([^"]*\)".*/\1/p') \ + && if [ -z "$PLEX_VER" ]; then \ + export PLEX_VER=$(wget -qO- https://adam-ant.co.uk/plex/version.php | sed -n 's/.*"release":\s*"\([^"]*\)".*/\1/p'); \ + fi \ && wget -O plexmediaserver.deb "https://downloads.plex.tv/plex-media-server/$PLEX_VER/plexmediaserver_"$PLEX_VER"_amd64.deb" \ && dpkg-deb -x plexmediaserver.deb . \ # Move usr/lib/plexmediaserver. Everything else is useless From e7e203fc7e02a6ecded5af0f70f0bca43a28f70f Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 20 Sep 2017 00:06:32 +0100 Subject: [PATCH 3/3] Print debug logs during build --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ab10a5d..bb0c5b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,8 @@ WORKDIR /tmp ARG PLEX_VER -RUN wget http://ftp.de.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_amd64.deb \ +RUN set -ax \ + && wget http://ftp.de.debian.org/debian/pool/main/g/gcc-6/libstdc++6_6.3.0-18_amd64.deb \ && wget http://ftp.de.debian.org/debian/pool/main/g/gcc-6/libgcc1_6.3.0-18_amd64.deb \ && dpkg-deb -x libstdc++6*.deb . \ && dpkg-deb -x libgcc1*.deb . \