Migrate to spritsail/plex-media-server

This commit is contained in:
Joe Groocock 2018-03-16 15:26:23 +00:00
parent ace5f7da0f
commit e5552397cf
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
3 changed files with 72 additions and 48 deletions

View File

@ -4,46 +4,52 @@ pipeline:
commands: commands:
# Grab the current version, prevents race conditions # Grab the current version, prevents race conditions
- apk add --no-cache openssl jq - apk add --no-cache openssl jq
- wget -qO- https://adam-ant.co.uk/plex/version.php | tee /dev/stderr | jq -r .release > .plex_version - wget -qO- https://spritsail.io/plex/release.php | tee .plex_release
- jq -r '.["url-deb"]' .plex_release > .plex_url
- jq -r '.["version"]' .plex_release > .plex_version
- jq -r '.["csum-deb"]' .plex_release > .plex_checksum
- jq -r '.["version"]' .plex_release | cut -d- -f1 > .plex_tag
build: build:
image: docker image: spritsail/docker-build
volumes: volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
- /var/run/docker.sock:/var/run/docker.sock repo: plex-dev
commands: build_args:
- docker build --no-cache --pull --build-arg PLEX_VER="$(cat .plex_version)" -t plex-dev . - 'PLEX_URL=%file: .plex_url'
- 'PLEX_VER=%file: .plex_version'
- 'PLEX_SHA=%file: .plex_checksum'
test: test:
image: docker image: docker
volumes: volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
- /var/run/docker.sock:/var/run/docker.sock
commands: commands:
- apk add --no-cache curl xmlstarlet grep - apk add --no-cache curl xmlstarlet grep
- export CUR_VERSION="$(cat .plex_version)" - export CUR_VERSION="$(cat .plex_version)"
- CON_NAME=$(docker run --rm -d plex-dev) - CON_NAME=$(docker run --rm -d plex-dev)
- timeout -t 15 docker logs $$CON_NAME & - timeout -t 15 docker logs $$CON_NAME &
- sleep 10 # Wait for plex to start! - sleep 10 # Wait for plex to start!
- curl -sSL $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $$CON_NAME):32400/identity - curl -sSL --retry-max-time 30 --max-time 5 --retry 10 --retry-delay 5
$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $$CON_NAME):32400/identity
| tee /dev/stderr | tee /dev/stderr
| xmlstarlet sel -t -v "/MediaContainer/@version" | xmlstarlet sel -t -v "/MediaContainer/@version"
| grep -qw $CUR_VERSION | grep -qw $CUR_VERSION
- docker kill $$CON_NAME - docker kill $$CON_NAME
publish: publish:
image: docker image: spritsail/docker-publish
when: volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
branch: [ master, pass ] secrets: [ docker_username, docker_password, microbadger_token ]
event: [ push, tag, deployment ] when: { branch: [ master, pass ], event: [ push, tag, deployment ] }
secrets: [ DOCKER_USER, DOCKER_PASS ] from: plex-dev
volumes: repo: spritsail/plex-media-server
- /var/run/docker.sock:/var/run/docker.sock tags:
commands: - 'latest'
# Grab just the version, not the hash. Used for tagging - '%fileauto: .plex_tag'
- export CUR_VERSION=$(cat .plex_version | cut -d \- -f1 )
- echo $DOCKER_USER notify:
- docker tag plex-dev adamant/plexmediaserver:latest image: appleboy/drone-telegram
- docker tag plex-dev adamant/plexmediaserver:$CUR_VERSION when: { status: [ success, failure ] }
- docker login -u $DOCKER_USER -p $DOCKER_PASS secrets: [ telegram_token, telegram_to ]
- docker push adamant/plexmediaserver message: |
- docker rmi adamant/plexmediaserver plex-dev *{{repo.owner}}/{{repo.name}} [{{commit.branch}}]*: Build #{{build.number}}: *{{uppercase build.status}}*
- echo "CONGRATS! SUCCESSFULLY BUILT PLEX VERSION $CUR_VERSION" {{build.link}}

View File

@ -1,35 +1,46 @@
FROM adamant/busybox:libressl FROM spritsail/busybox:libressl
MAINTAINER Adam Dodman <adam.dodman@gmx.com>
ARG PLEX_VER=latest
ARG PLEX_URL
ARG LIBSTDCPP_VER=8-20180312-2
ARG LIBGCC1_VER=8-20180312-2
LABEL maintainer="Spritsail <plex@spritsail.io>" \
org.label-schema.vendor="Spritsail" \
org.label-schema.name="Plex Media Server" \
org.label-schema.url="https://www.plex.tv/downloads/" \
org.label-schema.description="Tiny Docker image for Plex Media Server, built on spritsail/busybox" \
org.label-schema.version=$PLEX_VER
ENV SUID=900 SGID=900 ENV SUID=900 SGID=900
ADD start_pms /usr/sbin/start_pms ADD start_pms /usr/sbin/start_pms
WORKDIR /tmp WORKDIR /tmp
ARG PLEX_VER RUN chmod +x /usr/sbin/start_pms \
ARG LIBSTDCPP_VER=8-20180312-2
ARG LIBGCC1_VER=8-20180312-2
RUN set -ax \
&& wget http://ftp.de.debian.org/debian/pool/main/g/gcc-8/libstdc++6_${LIBSTDCPP_VER}_amd64.deb \ && wget http://ftp.de.debian.org/debian/pool/main/g/gcc-8/libstdc++6_${LIBSTDCPP_VER}_amd64.deb \
&& wget http://ftp.de.debian.org/debian/pool/main/g/gcc-8/libgcc1_${LIBGCC1_VER}_amd64.deb \ && wget http://ftp.de.debian.org/debian/pool/main/g/gcc-8/libgcc1_${LIBGCC1_VER}_amd64.deb \
&& dpkg-deb -x libstdc++6*.deb . \ && dpkg-deb -x libstdc++6*.deb . \
&& dpkg-deb -x libgcc1*.deb . \ && dpkg-deb -x libgcc1*.deb . \
# We only need the lib files, everything else is debian junk. # We only need the lib files, everything else is debian junk.
&& mv /tmp/usr/lib/x86_64-linux-gnu/* /lib \ && mv $PWD/usr/lib/x86_64-linux-gnu/* /lib \
&& mv /tmp/lib/x86_64-linux-gnu/* /lib \ && mv $PWD/lib/x86_64-linux-gnu/* /lib \
&& 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'); \ && if [ "$PLEX_VER" == "latest" -o -z "$PLEX_URL" ]; then \
export PLEX_VER="$(wget -qO- https://spritsail.io/plex/release.php?raw=version)"; \
export PLEX_URL="$(wget -qO- https://spritsail.io/plex/release.php?raw=url-deb)"; \
export PLEX_SHA="$(wget -qO- https://spritsail.io/plex/release.php?raw=csum-deb)"; \
fi \ fi \
&& wget -O plexmediaserver.deb "https://downloads.plex.tv/plex-media-server/$PLEX_VER/plexmediaserver_"$PLEX_VER"_amd64.deb" \ && echo "$PLEX_SHA plexmediaserver.deb" > sumfile \
&& wget -O plexmediaserver.deb "$PLEX_URL" \
&& sha1sum -c sumfile \
\
&& dpkg-deb -x plexmediaserver.deb . \ && dpkg-deb -x plexmediaserver.deb . \
# Move usr/lib/plexmediaserver. Everything else is useless
&& mv usr/lib/plexmediaserver /usr/lib \ && mv usr/lib/plexmediaserver /usr/lib \
&& chmod +x /usr/sbin/start_pms \ && find $PWD -mindepth 1 -delete
&& find /tmp -mindepth 1 -delete
HEALTHCHECK --interval=30s --timeout=12s CMD [ "wget", "-O", "/dev/null", "-T", "10", "-q", "localhost:32400/identity" ] HEALTHCHECK --interval=10s --timeout=5s \
CMD [ "wget", "-O", "/dev/null", "-T", "10", "-q", "localhost:32400/identity" ]
WORKDIR /usr/lib/plexmediaserver WORKDIR /usr/lib/plexmediaserver

View File

@ -1,12 +1,19 @@
[hub]: https://hub.docker.com/r/adamant/plexmediaserver [hub]: https://hub.docker.com/r/spritsail/plex-media-server
[git]: https://github.com/spritsail/plex-media-server
[drone]: https://drone.spritsail.io/spritsail/plex-media-server
# [adamant/plexmediaserver][hub] # [spritsail/plex-media-server][hub]
[![](https://images.microbadger.com/badges/image/adamant/plexmediaserver.svg)](https://microbadger.com/images/adamant/plexmediaserver) [![Docker Pulls](https://img.shields.io/docker/pulls/adamant/plexmediaserver.svg)][hub] [![Docker Stars](https://img.shields.io/docker/stars/adamant/plexmediaserver.svg)][hub] [![Build Status](https://drone.adam-ant.co.uk/api/badges/Adam-Ant/docker-plex-tiny/status.svg)](https://drone.adam-ant.co.uk/Adam-Ant/docker-plex-tiny) [![](https://images.microbadger.com/badges/image/spritsail/plex-media-server.svg)](https://microbadger.com/images/spritsail/plex-media-server)
[![Latest Version](https://images.microbadger.com/badges/version/spritsail/plex-media-server.svg)][hub]
[![Git Commit](https://images.microbadger.com/badges/commit/spritsail/plex-media-server.svg)][git]
[![Docker Pulls](https://img.shields.io/docker/pulls/spritsail/plex-media-server.svg)][hub]
[![Docker Stars](https://img.shields.io/docker/stars/spritsail/plex-media-server.svg)][hub]
[![Build Status](https://drone.spritsail.io/api/badges/spritsail/plex-media-server/status.svg)][drone]
The smallest* Plex Media Server docker image, built on [busybox](https://hub.docker.com/_/busybox/) with glibc and packages from the debian repos. The container contains a bare minimum glibc dependency tree, with most of the crap removed. The _smallest*_ Plex Media Server docker image, built on barebones [spritsail/busybox](https://hub.docker.com/spritsail/busybox/) with glibc and libraries from source. The container contains a bare minimum glibc dependency tree, with most of the useless crap removed, resulting in the smallest container possible whilst maintaining full functionality.
You can find out more about the [adamant/busybox](https://hub.docker.com/r/adamant/busybox) base image [here](https://github.com/Adam-Ant/docker-busybox-base), with the "package manager" scripts around dpkg You can find out more about the [spritsail/busybox](https://hub.docker.com/r/spritsail/busybox) base image [here](https://github.com/spritsail/busybox)
_*last we checked_ _*last we checked_