Merge branch 'master' into pass

This commit is contained in:
Joe Groocock 2018-03-17 09:21:49 +00:00
commit ef8e7619df
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
3 changed files with 75 additions and 51 deletions

View File

@ -4,47 +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/pass-version.php | tee /dev/stderr | jq -r .release > .plex_version - wget -qO- https://spritsail.io/plex/release.php?pass | 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: ppass-dev
commands: build_args:
- docker build --no-cache --pull --build-arg PLEX_VER="$(cat .plex_version)" -t ppass-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 ppass-dev) - CON_NAME=$(docker run --rm -d ppass-dev)
- timeout -t 30 docker logs $$CON_NAME & - timeout -t 15 docker logs $$CON_NAME &
- sleep 25 # 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 --retry-connrefused
$(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: ppass-dev
volumes: repo: spritsail/plex-media-server
- /var/run/docker.sock:/var/run/docker.sock tags:
commands: - 'plexpass'
# Grab just the version, not the hash. Used for tagging - '%fileauto: %prefix: plexpass% .plex_tag'
- export CUR_VERSION=$(cat .plex_version | cut -d \- -f1 )
- echo $CUR_VERSION notify:
- echo $DOCKER_USER image: appleboy/drone-telegram
- docker tag ppass-dev adamant/plexmediaserver:plexpass when: { status: [ success, failure ] }
- docker tag ppass-dev adamant/plexmediaserver:plexpass-$CUR_VERSION secrets: [ telegram_token, telegram_to ]
- docker login -u $DOCKER_USER -p $DOCKER_PASS message: |
- docker push adamant/plexmediaserver *{{repo.owner}}/{{repo.name}} [{{commit.branch}}]*: Build #{{build.number}}: *{{uppercase build.status}}*
- docker rmi adamant/plexmediaserver:plexpass adamant/plexmediaserver:plexpass-$CUR_VERSION ppass-dev {{build.link}}
- echo "CONGRATS! SUCCESSFULLY BUILT PLEX VERSION $CUR_VERSION-PASS"

View File

@ -1,35 +1,47 @@
FROM adamant/busybox:libressl FROM spritsail/busybox:libressl
MAINTAINER Adam Dodman <adam.dodman@gmx.com>
ARG PLEX_VER=latest
ARG PLEX_URL
ARG PLEX_SHA
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/pass-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?pass&raw=version)"; \
export PLEX_URL="$(wget -qO- https://spritsail.io/plex/release.php?pass&raw=url-deb)"; \
export PLEX_SHA="$(wget -qO- https://spritsail.io/plex/release.php?pass&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:plexpass.svg)](https://microbadger.com/images/adamant/plexmediaserver:plexpass) [![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:plexpass.svg)](https://microbadger.com/images/spritsail/plex-media-server:plexpass)
[![Latest Version](https://images.microbadger.com/badges/version/spritsail/plex-media-server:plexpass.svg)][hub]
[![Git Commit](https://images.microbadger.com/badges/commit/spritsail/plex-media-server:plexpass.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_