Dockerfile 5.4 KB

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