From 24ea89c4ed8390d5900c94825ffc311929d07624 Mon Sep 17 00:00:00 2001 From: Jay MOULIN Date: Thu, 23 Nov 2017 16:18:13 +0100 Subject: [PATCH] fixes #3 - added multiarch + crossbuild --- .gitignore | 3 +++ Dockerfile | 15 +++++++++++++++ Makefile | 20 ++++++++++++++++++++ README.md | 3 +-- manifest.yml | 30 ++++++++++++++++++++++++++++++ pc/Dockerfile | 11 ----------- rpi/Dockerfile | 11 ----------- 7 files changed, 69 insertions(+), 24 deletions(-) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 manifest.yml delete mode 100644 pc/Dockerfile delete mode 100644 rpi/Dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c21a57 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.Dockerfile +*.yaml +qemu-*-static diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ccaac37 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM debian:stable-slim as builder + +COPY qemu-*-static /usr/bin/ + +FROM builder + +LABEL maintainer="Jay MOULIN " + +RUN apt-get update && apt-get install libav-tools -y --force-yes + +ADD ./convert.sh /usr/bin/convert.sh + +VOLUME /media + +CMD ["convert.sh"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5840fb8 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +VERSION ?= 0.2.0 +FULLVERSION ?= ${VERSION} +archs = amd64 arm32v5 arm32v7 arm64v8 i386 + +.PHONY: all build publish latest +all: build publish latest +build: + cp /usr/bin/qemu-*-static . + $(foreach arch,$(archs), \ + cat Dockerfile | sed "s/FROM debian:stable-slim/FROM ${arch}\/debian:stable-slim/g" > .Dockerfile; \ + docker build -t jaymoulin/rpi-plex-video-converter:${VERSION}-$(arch) -f .Dockerfile .;\ + ) +publish: + docker push jaymoulin/rpi-plex-video-converter + cat manifest.yml | sed "s/\$$VERSION/${VERSION}/g" > manifest.yaml + cat manifest.yaml | sed "s/\$$FULLVERSION/${FULLVERSION}/g" > manifest2.yaml + mv manifest2.yaml manifest.yaml + manifest-tool push from-spec manifest.yaml +latest: build + FULLVERSION=latest VERSION=${VERSION} make publish diff --git a/README.md b/README.md index 48e5eae..727da44 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Raspberry PI - Plex Video converter - Docker Image [![Bitcoin donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/btc.png "Bitcoin donation")](https://m.freewallet.org/id/374ad82e/btc) [![Litecoin donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/ltc.png "Litecoin donation")](https://m.freewallet.org/id/374ad82e/ltc) [![PayPal donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/ppl.png "PayPal donation")](https://www.paypal.me/jaymoulin) -[![Beerpay donation](https://beerpay.io/jaymoulin/docker-rpi-plex-video-converter/badge.svg "Beerpay donation")](https://beerpay.io/jaymoulin/docker-rpi-plex-video-converter) This image purpose is to convert unsupported video files by Plex for Raspberry to mp4 which is supported. @@ -25,7 +24,7 @@ docker run --rm -t -v /path/to/your/media/folder:/media jaymoulin/rpi-plex-video Appendixes --- -### Install RaspberryPi Docker +### Install Docker If you don't have Docker installed yet, you can do it easily in one line using this command diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 0000000..0b9507f --- /dev/null +++ b/manifest.yml @@ -0,0 +1,30 @@ +image: jaymoulin/rpi-plex-video-converter:$FULLVERSION +manifests: + - + image: jaymoulin/rpi-plex-video-converter:$VERSION-arm32v5 + platform: + architecture: arm + variant: v5 + os: linux + - + image: jaymoulin/rpi-plex-video-converter:$VERSION-arm32v7 + platform: + architecture: arm + variant: v7 + os: linux + - + image: jaymoulin/rpi-plex-video-converter:$VERSION-arm64v8 + platform: + architecture: arm + variant: v8 + os: linux + - + image: jaymoulin/rpi-plex-video-converter:$VERSION-amd64 + platform: + architecture: arm64 + os: linux + - + image: jaymoulin/rpi-plex-video-converter:$VERSION-i386 + platform: + architecture: 386 + os: linux diff --git a/pc/Dockerfile b/pc/Dockerfile deleted file mode 100644 index 6e279ac..0000000 --- a/pc/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM debian - -MAINTAINER Jay MOULIN - -RUN apt-get update && apt-get install libav-tools -y --force-yes - -ADD ./convert.sh /usr/bin/convert.sh - -VOLUME /media - -CMD ["convert.sh"] diff --git a/rpi/Dockerfile b/rpi/Dockerfile deleted file mode 100644 index 053a5c5..0000000 --- a/rpi/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM sdhibit/rpi-raspbian - -MAINTAINER Jay MOULIN - -RUN apt-get update && apt-get install libav-tools -y --force-yes - -ADD ./convert.sh /usr/bin/convert.sh - -VOLUME /media - -CMD ["convert.sh"]