Dockerfile 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. FROM lsiobase/alpine:3.7
  2. # set version label
  3. ARG BUILD_DATE
  4. ARG VERSION
  5. LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
  6. LABEL maintainer="saarg"
  7. # package versions
  8. ARG ARGTABLE_VER="2.13"
  9. ARG TVH_VER="release/4.2"
  10. ARG TZ="Europe/Oslo"
  11. ARG XMLTV_VER="0.5.69"
  12. # environment settings
  13. ENV HOME="/config"
  14. # copy patches
  15. COPY patches/ /tmp/patches/
  16. RUN \
  17. echo "**** install build packages ****" && \
  18. apk add --no-cache --virtual=build-dependencies \
  19. autoconf \
  20. automake \
  21. cmake \
  22. ffmpeg-dev \
  23. file \
  24. findutils \
  25. g++ \
  26. gcc \
  27. gettext-dev \
  28. git \
  29. libgcrypt-dev \
  30. libhdhomerun-dev \
  31. libressl-dev \
  32. libtool \
  33. libvpx-dev \
  34. libxml2-dev \
  35. libxslt-dev \
  36. make \
  37. mercurial \
  38. opus-dev \
  39. patch \
  40. pcre2-dev \
  41. perl-dev \
  42. pkgconf \
  43. sdl-dev \
  44. uriparser-dev \
  45. wget \
  46. x264-dev \
  47. x265-dev \
  48. zlib-dev && \
  49. apk add --no-cache --virtual=build-dependencies \
  50. --repository http://nl.alpinelinux.org/alpine/edge/testing \
  51. gnu-libiconv-dev && \
  52. echo "**** install runtime packages ****" && \
  53. apk add --no-cache \
  54. bsd-compat-headers \
  55. bzip2 \
  56. curl \
  57. ffmpeg \
  58. ffmpeg-libs \
  59. gzip \
  60. libcrypto1.0 \
  61. libcurl \
  62. libhdhomerun-libs \
  63. libressl \
  64. libssl1.0 \
  65. libvpx \
  66. libxml2 \
  67. libxslt \
  68. linux-headers \
  69. opus \
  70. pcre2 \
  71. perl \
  72. perl-archive-zip \
  73. perl-boolean \
  74. perl-capture-tiny \
  75. perl-cgi \
  76. perl-compress-raw-zlib \
  77. perl-data-dumper \
  78. perl-date-manip \
  79. perl-datetime \
  80. perl-datetime-format-strptime \
  81. perl-datetime-timezone \
  82. perl-dbd-sqlite \
  83. perl-dbi \
  84. perl-digest-sha1 \
  85. perl-doc \
  86. perl-file-slurp \
  87. perl-file-temp \
  88. perl-file-which \
  89. perl-getopt-long \
  90. perl-html-parser \
  91. perl-html-tree \
  92. perl-http-cookies \
  93. perl-io \
  94. perl-io-compress \
  95. perl-io-html \
  96. perl-io-socket-ssl \
  97. perl-io-stringy \
  98. perl-json \
  99. perl-libwww \
  100. perl-lingua-en-numbers-ordinate \
  101. perl-lingua-preferred \
  102. perl-list-moreutils \
  103. perl-module-build \
  104. perl-module-pluggable \
  105. perl-net-ssleay \
  106. perl-parse-recdescent \
  107. perl-path-class \
  108. perl-scalar-list-utils \
  109. perl-term-progressbar \
  110. perl-term-readkey \
  111. perl-test-exception \
  112. perl-test-requires \
  113. perl-timedate \
  114. perl-try-tiny \
  115. perl-unicode-string \
  116. perl-xml-libxml \
  117. perl-xml-libxslt \
  118. perl-xml-parser \
  119. perl-xml-sax \
  120. perl-xml-treepp \
  121. perl-xml-twig \
  122. perl-xml-writer \
  123. python \
  124. tar \
  125. uriparser \
  126. wget \
  127. x264 \
  128. x265 \
  129. zlib && \
  130. apk add --no-cache \
  131. --repository http://nl.alpinelinux.org/alpine/edge/testing \
  132. gnu-libiconv && \
  133. echo "**** install perl modules for xmltv ****" && \
  134. curl -L http://cpanmin.us | perl - App::cpanminus && \
  135. cpanm --installdeps /tmp/patches && \
  136. echo "**** build dvb-apps ****" && \
  137. hg clone http://linuxtv.org/hg/dvb-apps /tmp/dvb-apps && \
  138. cd /tmp/dvb-apps && \
  139. make -C lib && \
  140. make -C lib install && \
  141. echo "**** remove musl iconv.h and replace with gnu-iconv.h ****" && \
  142. rm -rf /usr/include/iconv.h && \
  143. cp /usr/include/gnu-libiconv/iconv.h /usr/include/iconv.h && \
  144. echo "**** build tvheadend ****" && \
  145. git clone -b ${TVH_VER} --single-branch https://github.com/tvheadend/tvheadend.git /tmp/tvheadend && \
  146. cd /tmp/tvheadend && \
  147. ./configure \
  148. --disable-ffmpeg_static \
  149. --disable-hdhomerun_static \
  150. --disable-libfdkaac_static \
  151. --disable-libmfx_static \
  152. --disable-libtheora_static \
  153. --disable-libvorbis_static \
  154. --disable-libvpx_static \
  155. --disable-libx264_static \
  156. --disable-libx265_static \
  157. --enable-hdhomerun_client \
  158. --enable-libav \
  159. --enable-pngquant \
  160. --disable-avahi \
  161. --disable-dbus_1 \
  162. --disable-bintray_cache \
  163. --infodir=/usr/share/info \
  164. --localstatedir=/var \
  165. --mandir=/usr/share/man \
  166. --prefix=/usr \
  167. --sysconfdir=/config && \
  168. make && \
  169. make install && \
  170. echo "**** build XMLTV ****" && \
  171. curl -o \
  172. /tmp/xmtltv-src.tar.bz2 -L \
  173. "http://kent.dl.sourceforge.net/project/xmltv/xmltv/${XMLTV_VER}/xmltv-${XMLTV_VER}.tar.bz2" && \
  174. tar xf \
  175. /tmp/xmtltv-src.tar.bz2 -C \
  176. /tmp --strip-components=1 && \
  177. cd "/tmp/xmltv-${XMLTV_VER}" && \
  178. echo "**** Perl 5.26 fixes for XMTLV ****" && \
  179. sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_latex && \
  180. sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_text && \
  181. sed "s/\(lib\/set_share_dir.pl';\)/.\/\1/" -i grab/it/tv_grab_it.PL && \
  182. sed "s/\(filter\/Grep.pm';\)/.\/\1/" -i filter/tv_grep.PL && \
  183. sed "s/\(lib\/XMLTV.pm.in';\)/.\/\1/" -i lib/XMLTV.pm.PL && \
  184. sed "s/\(lib\/Ask\/Term.pm';\)/.\/\1/" -i Makefile.PL && \
  185. PERL5LIB=`pwd` && \
  186. echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor && \
  187. make && \
  188. make test && \
  189. make install && \
  190. echo "**** build argtable2 ****" && \
  191. ARGTABLE_VER1="${ARGTABLE_VER//./-}" && \
  192. mkdir -p \
  193. /tmp/argtable && \
  194. curl -o \
  195. /tmp/argtable-src.tar.gz -L \
  196. "https://sourceforge.net/projects/argtable/files/argtable/argtable-${ARGTABLE_VER}/argtable${ARGTABLE_VER1}.tar.gz" && \
  197. tar xf \
  198. /tmp/argtable-src.tar.gz -C \
  199. /tmp/argtable --strip-components=1 && \
  200. cp /tmp/patches/config.* /tmp/argtable && \
  201. cd /tmp/argtable && \
  202. ./configure \
  203. --prefix=/usr && \
  204. make && \
  205. make check && \
  206. make install && \
  207. echo "***** build comskip ****" && \
  208. git clone git://github.com/erikkaashoek/Comskip /tmp/comskip && \
  209. cd /tmp/comskip && \
  210. ./autogen.sh && \
  211. ./configure \
  212. --bindir=/usr/bin \
  213. --sysconfdir=/config/comskip && \
  214. make && \
  215. make install && \
  216. echo "***** cleanup ****" && \
  217. apk del --purge \
  218. build-dependencies && \
  219. rm -rf \
  220. /config/.cpanm \
  221. /tmp/*
  222. # copy local files
  223. COPY root/ /
  224. # add picons
  225. ADD picons.tar.bz2 /picons
  226. # ports and volumes
  227. EXPOSE 9981 9982
  228. VOLUME /config /recordings