From a2110c9ecc662c1475651fa0420756bb437b9743 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 23 Jun 2021 16:01:08 +0100 Subject: [PATCH] Add nvidia libraries into :nvidia image Pull the nvidia encoding and decoding libraries from Debian and include them in the image. This change is only a test and doesn't build the base Plex image first, which the CI pipeline should do when this is merged into pass. Fixes #34 Signed-off-by: Joe Groocock --- .drone.yml | 35 ++++++++++------------------------- Dockerfile.nvidia | 27 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 25 deletions(-) create mode 100644 Dockerfile.nvidia diff --git a/.drone.yml b/.drone.yml index be2d5e7..5ed82d5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,54 +1,39 @@ --- kind: pipeline -name: build-amd64 +name: build-nvidia-amd64 platform: os: linux arch: amd64 +#depends_on: +#- build-amd64 + steps: - name: build pull: always image: spritsail/docker-build settings: + dockerfile: Dockerfile.nvidia make: true -- name: test-bin - pull: always - image: spritsail/docker-test - settings: - run: | - busybox && \ - curl --version && \ - xmlstarlet --version - -- name: test - pull: always - image: spritsail/docker-test - settings: - curl: :32400/identity - delay: 5 - pipe: | - xmlstarlet sel -t -v "/MediaContainer/@version" | - grep -qw "$(label io.spritsail.version.plex | cut -d- -f1)" - retry: 10 - - name: publish pull: always image: spritsail/docker-publish settings: repo: spritsail/plex-media-server tags: - - plexpass - - "%label io.spritsail.version.plex | %prefix plexpass | %remsuf [0-9a-f]+$ | %auto 2" + - plexpass-nvidia + - "%label io.spritsail.version.plex | %prefix plexpass-nvidia | %remsuf [0-9a-f]+$ | %auto 2" login: {from_secret: docker_login} when: branch: - - pass + - nvidia event: - push + --- kind: signature -hmac: a6e529b62ed2ecf24b2c3125f7267c321d56ce16d1cd8178f96e0399dd3096bd +hmac: d7799de75f1932b1aa3757273cad30c30d56442175e1ca2714720b252f6d7398 ... diff --git a/Dockerfile.nvidia b/Dockerfile.nvidia new file mode 100644 index 0000000..5c336ac --- /dev/null +++ b/Dockerfile.nvidia @@ -0,0 +1,27 @@ +ARG PLEX_VER=1.23.4.4712 +ARG NVIDIA_VER=465.31 +ARG NVIDIA_REV=1 +ARG ARCH=amd64 + +FROM alpine + +ARG NVIDIA_VER +ARG NVIDIA_REV +ARG ARCH + +RUN apk add --no-cache curl dpkg && \ + for pkg in libnvcuvid1 libnvidia-encode1; do \ + curl -fsSLO https://deb.debian.org/debian/pool/non-free/n/nvidia-graphics-drivers/${pkg}_${NVIDIA_VER}-${NVIDIA_REV}_${ARCH}.deb && \ + dpkg-deb -x ${pkg}_${NVIDIA_VER}-${NVIDIA_REV}_${ARCH}.deb /nvidia; \ + done + +# ~~~~~~~~~~~~~~~~~~ + +FROM spritsail/plex-media-server:plexpass-${PLEX_VER} + +ARG NVIDIA_VER + +COPY --from=0 \ + /nvidia/usr/lib/x86_64-linux-gnu/nvidia/current/libnvcuvid.so.${NVIDIA_VER} \ + /nvidia/usr/lib/x86_64-linux-gnu/nvidia/current/libnvidia-encode.so.${NVIDIA_VER} \ + /usr/lib/