diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0c2e082 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,7 @@ +pipeline: + docker: + image: plugins/docker + repo: docker.jcg.re/emby + registry: docker.jcg.re + secrets: [ docker_username, docker_password ] + tags: latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..61247b2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +FROM registry.fedoraproject.org/fedora:27 +MAINTAINER Jan Christian Grünhage + +ARG VERSION=3.2.50.0 + +ENV UID=1337 \ + GID=1337 + +RUN dnf install -y \ + mono-devel \ + sqlite-devel \ + https://download.mono-project.com/repo/centos7/r/referenceassemblies-pcl/referenceassemblies-pcl-4.6-0.noarch.rpm \ + wget \ + patch \ + binutils \ + && cd /tmp \ + && wget -O emby.tar.gz https://github.com/MediaBrowser/Emby/archive/${VERSION}.tar.gz \ + && wget -O patches.tar.gz https://github.com/nvllsvm/emby-unlocked/archive/${VERSION}.tar.gz \ + && tar -xf emby.tar.gz \ + && tar -xf patches.tar.gz \ + && cd Emby-${VERSION} \ + && patch -N -p1 -r - Emby.Server.Implementations/Security/PluginSecurityManager.cs < \ + ../emby-unlocked-${VERSION}/patches/PluginSecurityManager.cs.patch \ + && xbuild \ + /p:Configuration='Release Mono' \ + /p:Platform='Any CPU' \ + /p:OutputPath="/opt/emby" \ + /t:build MediaBrowser.sln \ + && mono --aot='full' -O='all' /opt/emby/MediaBrowser.Server.Mono.exe \ + && cp ../emby-unlocked-${VERSION}/replacements/connectionmanager.js /opt/emby/dashboard-ui/bower_components/emby-apiclient/ + +ADD root / + +EXPOSE 8096 + +VOLUME ["/data", "/media"] + +ENTRYPOINT /usr/local/bin/run.sh diff --git a/README.md b/README.md index ded0762..9aebe1b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,45 @@ -# docker-emby +## docker.jcg.re/emby +Docker image running a liberated version of emby. -Docker image running a liberated version of emby. \ No newline at end of file +#### Tags: + - **latest**: latest stable version + +#### Build Arguments: + - **VERSION**: What version to build. + This version needs to be available in both emby and emby-unlocked. + +#### Environment variables: + - **UID**: User to run emby as. + - **GID**: Group to run emby as. + +#### Volumes: + - **/data**: application data. + - **/media**: media + +#### Ports: + - **8096**: HTTP Port. + +#### Basic `docker-compose.yml` example: +A basic example for docker-compose: +```yaml +version: '2' + +services: + emby: + image: docker.jcg.re/emby + container_name: emby + ports: + - 8096 + volumes: + - ./data:/data:z + - ./media:/media:z +``` + +The `:z` mount options are needed on RedHat systemd hosts. +You probably want to run this behind a reverse proxy, like caddy. + +### Credits: +I've used the following open source things in here: + - [emby.media](https://github.com/MediaBrowser/Emby) (GPLv2) + - [emby-unlocked](https://github.com/nvllsvm/emby-unlocked) (GPLv2) + - [su-exec](https://github.com/ncopa/su-exec) (MIT) diff --git a/root/usr/local/bin/run.sh b/root/usr/local/bin/run.sh new file mode 100755 index 0000000..ff2b714 --- /dev/null +++ b/root/usr/local/bin/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash +chown -R ${UID}:${GID} /data +chown -R ${UID}:${GID} /media +exec su-exec ${UID}:${GID} mono /opt/emby/MediaBrowser.Server.Mono.exe -programdata /data diff --git a/root/usr/local/bin/su-exec b/root/usr/local/bin/su-exec new file mode 100755 index 0000000..e6ec3e8 Binary files /dev/null and b/root/usr/local/bin/su-exec differ