2
0
mirror of https://github.com/spritsail/plex-media-server.git synced 2024-11-05 01:16:23 +00:00

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:
# Grab the current version, prevents race conditions
- 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:
image: docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
commands:
- docker build --no-cache --pull --build-arg PLEX_VER="$(cat .plex_version)" -t plex-dev .
image: spritsail/docker-build
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
repo: plex-dev
build_args:
- 'PLEX_URL=%file: .plex_url'
- 'PLEX_VER=%file: .plex_version'
- 'PLEX_SHA=%file: .plex_checksum'
test:
image: docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
commands:
- apk add --no-cache curl xmlstarlet grep
- export CUR_VERSION="$(cat .plex_version)"
- CON_NAME=$(docker run --rm -d plex-dev)
- timeout -t 15 docker logs $$CON_NAME &
- 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
| xmlstarlet sel -t -v "/MediaContainer/@version"
| grep -qw $CUR_VERSION
- docker kill $$CON_NAME
publish:
image: docker
when:
branch: [ master, pass ]
event: [ push, tag, deployment ]
secrets: [ DOCKER_USER, DOCKER_PASS ]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
commands:
# Grab just the version, not the hash. Used for tagging
- export CUR_VERSION=$(cat .plex_version | cut -d \- -f1 )
- echo $DOCKER_USER
- docker tag plex-dev adamant/plexmediaserver:latest
- docker tag plex-dev adamant/plexmediaserver:$CUR_VERSION
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- docker push adamant/plexmediaserver
- docker rmi adamant/plexmediaserver plex-dev
- echo "CONGRATS! SUCCESSFULLY BUILT PLEX VERSION $CUR_VERSION"
image: spritsail/docker-publish
volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
secrets: [ docker_username, docker_password, microbadger_token ]
when: { branch: [ master, pass ], event: [ push, tag, deployment ] }
from: plex-dev
repo: spritsail/plex-media-server
tags:
- 'latest'
- '%fileauto: .plex_tag'
notify:
image: appleboy/drone-telegram
when: { status: [ success, failure ] }
secrets: [ telegram_token, telegram_to ]
message: |
*{{repo.owner}}/{{repo.name}} [{{commit.branch}}]*: Build #{{build.number}}: *{{uppercase build.status}}*
{{build.link}}

View File

@ -1,35 +1,46 @@
FROM adamant/busybox:libressl
MAINTAINER Adam Dodman <adam.dodman@gmx.com>
FROM spritsail/busybox:libressl
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
ADD start_pms /usr/sbin/start_pms
WORKDIR /tmp
ARG PLEX_VER
ARG LIBSTDCPP_VER=8-20180312-2
ARG LIBGCC1_VER=8-20180312-2
RUN set -ax \
RUN chmod +x /usr/sbin/start_pms \
&& 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 \
&& dpkg-deb -x libstdc++6*.deb . \
&& dpkg-deb -x libgcc1*.deb . \
# 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 \
&& 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'); \
&& mv $PWD/usr/lib/x86_64-linux-gnu/* /lib \
&& mv $PWD/lib/x86_64-linux-gnu/* /lib \
\
&& 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 \
&& 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 . \
# Move usr/lib/plexmediaserver. Everything else is useless
&& mv usr/lib/plexmediaserver /usr/lib \
&& chmod +x /usr/sbin/start_pms \
&& find /tmp -mindepth 1 -delete
&& find $PWD -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

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_