commit cc60c56f7c8f638dfa99454d4c1622bb0c5f030d Author: sparklyballs Date: Mon Aug 7 16:14:08 2017 +0100 save up test build diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cdb1a82 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +.gitignore +.github +.gitattributes +READMETEMPLATE.md +README.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..c73c33b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,21 @@ + + +[linuxserverurl]: https://linuxserver.io +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + + + + + + + + + + + + + + + +## Thanks, team linuxserver.io + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f6a6381 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,15 @@ + + +[linuxserverurl]: https://linuxserver.io +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + + + + + + + + + +## Thanks, team linuxserver.io + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96374c4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,43 @@ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..92bf790 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,234 @@ +FROM lsiobase/alpine:3.6 +MAINTAINER sparklyballs + +# set version label +ARG BUILD_DATE +ARG VERSION +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" + +# package versions +ARG FFMPEG_VER="3.3.3" +ARG FRAME_COMMIT="874cf94eeaf35aa267878f9983b280a00e7bed19" + +# copy patches +COPY patches/ /tmp/patches/ + +# install build packages +RUN \ + apk add --no-cache --virtual=build-dependencies \ + alsa-lib-dev \ + autoconf \ + automake \ + bzip2-dev \ + cmake \ + coreutils \ + curl \ + file \ + g++ \ + gcc \ + git \ + gnutls-dev \ + jpeg-dev \ + lame-dev \ + lcms2-dev \ + libass-dev \ + libtheora-dev \ + libtool \ + libva-dev \ + libvorbis-dev \ + libvpx-dev \ + libwebp-dev \ + libxfixes-dev \ + make \ + openjpeg-dev \ + opus-dev \ + perl \ + rtmpdump-dev \ + sdl-dev \ + soxr-dev \ + speex-dev \ + tar \ + v4l-utils-dev \ + x264-dev \ + x265-dev \ + xvidcore-dev \ + yasm \ + zlib-dev && \ + apk add --no-cache --virtual=build-dependencies \ + --repository http://nl.alpinelinux.org/alpine/edge/testing \ + frei0r-plugins-dev && \ + +# install runtime packages + apk add --no-cache \ + alsa-lib \ + fontconfig \ + freetype \ + fribidi \ + imagemagick \ + libgomp \ + librtmp \ + libtheora \ + libva \ + libva-intel-driver \ + libvorbis \ + libvpx \ + libwebp \ + libxcb \ + openjpeg \ + opus \ + soxr \ + speex \ + sqlite \ + v4l-utils-libs \ + x264 \ + x264-libs \ + x265 \ + xvidcore && \ + apk add --no-cache \ + --repository http://nl.alpinelinux.org/alpine/edge/testing \ + frei0r-plugins \ + mono && \ + +# compile opencore + mkdir -p \ + /tmp/opencore-amr && \ + curl -o \ + /tmp/opencore-src.tar.gz -L \ + "https://sourceforge.net/projects/opencore-amr/files/latest/download" && \ + tar xf \ + /tmp/opencore-src.tar.gz -C \ + /tmp/opencore-amr --strip-components=1 && \ + cd /tmp/opencore-amr && \ + ./configure \ + --prefix=/usr && \ + make && \ + make install && \ + mkdir -p \ + /tmp/opencore-amrwbenc && \ + curl -o \ + /tmp/opencore-amrwbenc-src.tar.gz -L \ + "https://sourceforge.net/projects/opencore-amr/files/vo-amrwbenc/vo-amrwbenc-0.1.3.tar.gz/download" && \ + tar xf \ + /tmp/opencore-amrwbenc-src.tar.gz -C \ + /tmp/opencore-amrwbenc && \ + ./configure \ + --prefix=/usr && \ + make && \ + make install && \ + libtool --finish /usr/lib && \ + +# compile vidstab + git clone https://github.com/georgmartius/vid.stab /tmp/vidstap && \ + cd /tmp/vidstap && \ + cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/ && \ + make && \ + make install && \ + +# compile zimg + git clone https://github.com/sekrit-twc/zimg /tmp/zimg && \ + cd /tmp/zimg && \ + ./autogen.sh && \ + ./configure \ + --prefix=/usr && \ + make && \ + make install && \ + +# compile ffmpeg + mkdir -p /tmp/ffmpeg-src && \ + curl -o \ + /tmp/ffmpeg.tar.bz2 -L \ + "http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VER}.tar.bz2" && \ + tar xf \ + /tmp/ffmpeg.tar.bz2 -C \ + /tmp/ffmpeg-src --strip-components=1 && \ + cd /tmp/ffmpeg-src && \ + for i in /tmp/patches/*.patch; do patch -p1 -i $i; done && \ + ./configure \ + --disable-debug \ + --disable-ffplay \ + --disable-indev=sndio \ + --disable-outdev=sndio \ + --disable-static \ + --disable-stripping \ + --enable-fontconfig \ + --enable-frei0r \ + --enable-gpl \ + --enable-gray \ + --enable-libfreetype \ + --enable-libfribidi \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-librtmp \ + --enable-libsoxr \ + --enable-libspeex \ + --enable-libtheora \ + --enable-libv4l2 \ + --enable-libvidstab \ +# --enable-libvo-amrwbenc \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-shared \ + --enable-vaapi \ + --enable-version3 \ + --prefix=/usr && \ + make && \ + make install && \ + +# install referenceassemblies-pcl + git clone https://github.com/directhex/xamarin-referenceassemblies-pcl /tmp/pcl && \ + cd /tmp/pcl && \ + git checkout $FRAME_COMMIT && \ + install -dm 755 /usr/lib/mono/xbuild-frameworks/.NETPortable/ && \ + cp -dr --no-preserve='ownership' v4.* /usr/lib/mono/xbuild-frameworks/.NETPortable/ && \ + +# compile emby + mkdir -p \ + /tmp/emby-src/build && \ + EMBY_VER=$(curl -sX GET "https://api.github.com/repos/mediaBrowser/Emby/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]') && \ + curl -o \ + /tmp/emby.tar.gz -L \ + "https://github.com/MediaBrowser/Emby/archive/$EMBY_VER.tar.gz" && \ + tar xf \ + /tmp/emby.tar.gz -C \ + /tmp/emby-src --strip-components=1 && \ + SQL_DLL=$(find / -name "*sqlite3.dll.config*") && \ + cd /tmp/emby-src && \ + libMagicWand=$(find / -iname "libMagickWand-7.*.so.0" -exec basename \{} \;) && \ + sed -i \ + s/libMagickWand-6.Q8.so/$libMagicWand/g \ + /tmp/emby-src/MediaBrowser.Server.Mono/ImageMagickSharp.dll.config && \ + libSqlite=$(find / -iname "libsqlite*.so.0" -exec basename \{} \;) && \ + SQLITE_DLL=$(find /tmp/emby-src -iname "*sqlite3.dll.config") && \ + sed -i \ + s/libsqlite3.so/$libSqlite/g \ + $SQLITE_DLL && \ + xbuild \ + /p:Configuration='Release Mono' \ + /p:Platform='Any CPU' \ + /p:OutputPath=/tmp/emby-src/build \ + /t:build MediaBrowser.Mono.sln && \ + mkdir -p \ + /usr/lib/emby && \ + cp -r /tmp/emby-src/build/* /usr/lib/emby/ && \ + +# cleanup + apk del --purge \ + build-dependencies && \ + rm -rf \ + /tmp/* \ + /usr/lib/mono/xbuild-frameworks/.NETPortable/v4.* + +# add local files +COPY root/ / + +# ports and volumes +# EXPOSE +VOLUME /config diff --git a/README.md b/README.md new file mode 100644 index 0000000..3a8b3d2 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +[linuxserverurl]: https://linuxserver.io +[forumurl]: https://forum.linuxserver.io +[ircurl]: https://www.linuxserver.io/irc/ +[podcasturl]: https://www.linuxserver.io/podcast/ + +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + +## This is a Container in active development by the [LinuxServer.io][linuxserverurl] team and is not recommended for use by the general public. + +If you want to comment\contribute on this container , are looking for support on any of our other work , or are curious about us in general, check out the following. + +* [forum.linuxserver.io][forumurl] +* [IRC][ircurl] on freenode at `#linuxserver.io` +* [Podcast][podcasturl] covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! + diff --git a/READMETEMPLATE.md b/READMETEMPLATE.md new file mode 100644 index 0000000..e7bb2fe --- /dev/null +++ b/READMETEMPLATE.md @@ -0,0 +1,81 @@ +[linuxserverurl]: https://linuxserver.io +[forumurl]: https://forum.linuxserver.io +[ircurl]: https://www.linuxserver.io/irc/ +[podcasturl]: https://www.linuxserver.io/podcast/ +[appurl]: www.example.com +[hub]: https://hub.docker.com/r/example/example/ + +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + +The [LinuxServer.io][linuxserverurl] team brings you another container release featuring easy user mapping and community support. Find us for support at: +* [forum.linuxserver.io][forumurl] +* [IRC][ircurl] on freenode at `#linuxserver.io` +* [Podcast][podcasturl] covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! + +# + +Provide a short, concise description of the application. No more than two SHORT paragraphs. Link to sources where possible and include an image illustrating your point if necessary. Point users to the original applications website, as that's the best place to get support - not here. + +Our Plex container has immaculate docs so follow that if in doubt for layout. + +`IMPORTANT, replace all instances of with the correct dockerhub repo (ie linuxserver/plex) and information (ie, plex)` + +## Usage + +``` +docker create \ + --name= \ + -v :/config \ + -e PGID= -e PUID= \ + -p 1234:1234 \ + +``` + +## Parameters + +`The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. +For example with a port -p external:internal - what this shows is the port mapping from internal to external of the container. +So -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 +http://192.168.x.x:8080 would show you what's running INSIDE the container on port 80.` + + + +* `-p 1234` - the port(s) +* `-v /config` - explain what lives here +* `-e PGID` for GroupID - see below for explanation +* `-e PUID` for UserID - see below for explanation + +It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it /bin/bash`. + +### User / Group Identifiers + +Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™. + +In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below: + +``` + $ id + uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) +``` + +## Setting up the application + +Insert a basic user guide here to get a n00b up and running with the software inside the container. DELETE ME + + +## Info + +* Shell access whilst the container is running: `docker exec -it /bin/bash` +* To monitor the logs of the container in realtime: `docker logs -f ` + +* container version number + +`docker inspect -f '{{ index .Config.Labels "build_version" }}' ` + +* image version number + +`docker inspect -f '{{ index .Config.Labels "build_version" }}' ` + +## Versions + ++ **dd.MM.yy:** Initial Release. diff --git a/list b/list new file mode 100644 index 0000000..63fae42 --- /dev/null +++ b/list @@ -0,0 +1,24 @@ + alsa-lib \ + fontconfig \ + freetype \ + fribidi \ + imagemagick \ + libgomp \ + librtmp \ + libtheora \ + libva \ + libva-intel-driver \ + libvorbis \ + libvpx \ + libwebp \ + libxcb \ + openjpeg \ + opus \ + soxr \ + speex \ + sqlite \ + v4l-utils-libs \ + x264 \ + x264-libs \ + x265 \ + xvidcore && \ diff --git a/patches/0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch b/patches/0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch new file mode 100644 index 0000000..93e3ac9 --- /dev/null +++ b/patches/0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch @@ -0,0 +1,55 @@ +From ab11be0becb90542f10d5713659b559842c53af2 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Tue, 29 Mar 2016 15:15:17 +0200 +Subject: [PATCH] libavutil: clean up unused FF_SYMVER macro + +There is nothing using it since commit d63443b9 (lavc: drop the +av_fast_{re,m}alloc compatibility wrappers). + +Signed-off-by: Natanael Copa +--- + libavutil/internal.h | 28 ---------------------------- + 1 file changed, 28 deletions(-) + +diff --git a/libavutil/internal.h b/libavutil/internal.h +index 61784b5..69d63d5 100644 +--- a/libavutil/internal.h ++++ b/libavutil/internal.h +@@ -177,34 +177,6 @@ + #endif + + /** +- * Define a function with only the non-default version specified. +- * +- * On systems with ELF shared libraries, all symbols exported from +- * FFmpeg libraries are tagged with the name and major version of the +- * library to which they belong. If a function is moved from one +- * library to another, a wrapper must be retained in the original +- * location to preserve binary compatibility. +- * +- * Functions defined with this macro will never be used to resolve +- * symbols by the build-time linker. +- * +- * @param type return type of function +- * @param name name of function +- * @param args argument list of function +- * @param ver version tag to assign function +- */ +-#if HAVE_SYMVER_ASM_LABEL +-# define FF_SYMVER(type, name, args, ver) \ +- type ff_##name args __asm__ (EXTERN_PREFIX #name "@" ver); \ +- type ff_##name args +-#elif HAVE_SYMVER_GNU_ASM +-# define FF_SYMVER(type, name, args, ver) \ +- __asm__ (".symver ff_" #name "," EXTERN_PREFIX #name "@" ver); \ +- type ff_##name args; \ +- type ff_##name args +-#endif +- +-/** + * Return NULL if a threading library has not been enabled. + * Used to disable threading functions in AVCodec definitions + * when not needed. +-- +2.7.4 + diff --git a/patches/cflags-speed-O2.patch b/patches/cflags-speed-O2.patch new file mode 100644 index 0000000..d09ca1c --- /dev/null +++ b/patches/cflags-speed-O2.patch @@ -0,0 +1,24 @@ +gcc fails if we compile with -O3 + +libavcodec/sbrdsp.c: In function 'sbr_neg_odd_64_c': +libavcodec/sbrdsp.c:47:13: internal compiler error: in vect_analyze_data_ref_accesses, at tree-vect-data-refs.c:2596 + static void sbr_neg_odd_64_c(float *x) + ^ + +We work around it by using -O2 which is more sane. + +http://bugs.alpinelinux.org/issues/5334 + +diff --git a/configure b/configure +index 5e788ac..aa34f9b 100755 +--- a/configure ++++ b/configure +@@ -3795,7 +3795,7 @@ probe_cc(){ + warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;; + esac + fi +- _cflags_speed='-O3' ++ _cflags_speed='-O2' + _cflags_size='-Os' + elif $_cc --version 2>/dev/null | grep -q ^icc; then + _type=icc diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config new file mode 100644 index 0000000..4a919c2 --- /dev/null +++ b/root/etc/cont-init.d/30-config @@ -0,0 +1,5 @@ +#!/usr/bin/with-contenv bash + +# permissions +chown -R abc:abc \ + /config diff --git a/root/etc/services.d/emby/run b/root/etc/services.d/emby/run new file mode 100644 index 0000000..90fcfca --- /dev/null +++ b/root/etc/services.d/emby/run @@ -0,0 +1,8 @@ +#!/usr/bin/with-contenv bash + +exec \ + s6-setuidgid abc /usr/bin/mono \ + /usr/lib/emby/MediaBrowser.Server.Mono.exe \ + -programdata /config -ffmpeg /usr/bin/ffmpeg \ + -ffprobe /usr/bin/ffprobe +