feat: add Dockerfile and ci
the build was successful Details

This commit is contained in:
Jan Christian Grünhage 2017-12-20 15:40:32 +01:00
parent 7af09f2837
commit 1630a514f8
Signed by: jcgruenhage
GPG Key ID: 6594C449C633D10C
5 changed files with 93 additions and 2 deletions

7
.drone.yml Normal file
View File

@ -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

38
Dockerfile Normal file
View File

@ -0,0 +1,38 @@
FROM registry.fedoraproject.org/fedora:27
MAINTAINER Jan Christian Grünhage <jan.christian@gruenhage.xyz>
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

View File

@ -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.
#### 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)

4
root/usr/local/bin/run.sh Executable file
View File

@ -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

BIN
root/usr/local/bin/su-exec Executable file

Binary file not shown.