Explorar o código

rebase to alpine 3.8 and use buildstage type build

sparklyballs %!s(int64=8) %!d(string=hai) anos
pai
achega
c92cf86b86
Modificáronse 3 ficheiros con 175 adicións e 86 borrados
  1. 168 86
      Dockerfile
  2. 1 0
      README.md
  3. 6 0
      list

+ 168 - 86
Dockerfile

@@ -1,17 +1,12 @@
-FROM lsiobase/alpine:3.7
-
-# set version label
-ARG BUILD_DATE
-ARG VERSION
-LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
-LABEL maintainer="saarg"
+FROM lsiobase/alpine:3.8 as buildstage
+############## build stage ##############
 
 # package versions
 ARG ARGTABLE_VER="2.13"
-ARG TZ="Europe/Oslo"
 ARG XMLTV_VER="0.5.69"
 
 # environment settings
+ARG TZ="Europe/Oslo"
 ENV HOME="/config"
 
 # copy patches
@@ -22,7 +17,10 @@ RUN \
  apk add --no-cache --virtual=build-dependencies \
 	autoconf \
 	automake \
+	bsd-compat-headers \
+	bzip2 \
 	cmake \
+	curl \
 	ffmpeg-dev \
 	file \
 	findutils \
@@ -30,6 +28,8 @@ RUN \
 	gcc \
 	gettext-dev \
 	git \
+	gzip \
+	libcurl \
 	libdvbcsa-dev \
 	libgcrypt-dev \
 	libhdhomerun-dev \
@@ -38,46 +38,12 @@ RUN \
 	libvpx-dev \
 	libxml2-dev \
 	libxslt-dev \
+	linux-headers \
 	make \
 	openssl-dev \
 	opus-dev \
 	patch \
 	pcre2-dev \
-	perl-dev \
-	pngquant \
-	pkgconf \
-	sdl-dev \
-	uriparser-dev \
-	wget \
-	x264-dev \
-	x265-dev \
-	zlib-dev && \
- apk add --no-cache --virtual=build-dependencies \
-	--repository http://nl.alpinelinux.org/alpine/edge/testing \
-	gnu-libiconv-dev && \
- echo "**** install runtime packages ****" && \
- apk add --no-cache \
-	bsd-compat-headers \
-	bzip2 \
-	curl \
-	ffmpeg \
-	ffmpeg-libs \
-	gzip \
-	libcrypto1.0 \
-	libcurl \
-	libdvbcsa \
-	libhdhomerun-libs \
-	libssl1.0 \
-	libva \
-	libva-intel-driver \
-	libvpx \
-	libxml2 \
-	libxslt \
-	linux-headers \
-	openssl \
-	opus \
-	pcre2 \
-	perl \
 	perl-archive-zip \
 	perl-boolean \
 	perl-capture-tiny \
@@ -90,6 +56,7 @@ RUN \
 	perl-datetime-timezone \
 	perl-dbd-sqlite \
 	perl-dbi \
+	perl-dev \
 	perl-digest-sha1 \
 	perl-doc \
 	perl-file-slurp \
@@ -129,23 +96,54 @@ RUN \
 	perl-xml-treepp \
 	perl-xml-twig \
 	perl-xml-writer \
+	pkgconf \
+	pngquant \
 	python \
+	sdl-dev \
 	tar \
-	uriparser \
+	uriparser-dev \
 	wget \
-	x264 \
-	x265 \
-	zlib && \
+	x264-dev \
+	x265-dev \
+	zlib-dev && \
  apk add --no-cache \
 	--repository http://nl.alpinelinux.org/alpine/edge/testing \
-	gnu-libiconv && \
- echo "**** install perl modules for xmltv ****" && \
- curl -L http://cpanmin.us | perl - App::cpanminus && \
- cpanm --installdeps /tmp/patches && \
+	gnu-libiconv-dev
+
+RUN \
  echo "**** remove musl iconv.h and replace with gnu-iconv.h ****" && \
  rm -rf /usr/include/iconv.h && \
- cp /usr/include/gnu-libiconv/iconv.h /usr/include/iconv.h && \
- echo "**** build tvheadend ****" && \
+ cp /usr/include/gnu-libiconv/iconv.h /usr/include/iconv.h
+
+RUN \
+ echo "**** install perl modules for xmltv ****" && \
+ curl -L http://cpanmin.us | perl - App::cpanminus && \
+ cpanm --installdeps /tmp/patches
+
+RUN \
+ echo "**** compile XMLTV ****" && \
+ curl -o \
+ /tmp/xmtltv-src.tar.bz2 -L \
+	"https://sourceforge.net/projects/xmltv/files/xmltv/${XMLTV_VER}/xmltv-${XMLTV_VER}.tar.bz2" && \
+ tar xf \
+ /tmp/xmtltv-src.tar.bz2 -C \
+	/tmp --strip-components=1 && \
+ cd "/tmp/xmltv-${XMLTV_VER}" && \
+ echo "**** Perl 5.26 fixes for XMTLV ****" && \
+ sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_latex && \
+ sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_text && \
+ sed "s/\(lib\/set_share_dir.pl';\)/.\/\1/" -i grab/it/tv_grab_it.PL && \
+ sed "s/\(filter\/Grep.pm';\)/.\/\1/" -i filter/tv_grep.PL && \
+ sed "s/\(lib\/XMLTV.pm.in';\)/.\/\1/" -i lib/XMLTV.pm.PL && \
+ sed "s/\(lib\/Ask\/Term.pm';\)/.\/\1/" -i Makefile.PL && \
+ PERL5LIB=`pwd` && \
+ echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor && \
+ make && \
+ make test && \
+ make DESTDIR=/tmp/xmltv-build install
+
+RUN \
+ echo "**** compile tvheadend ****" && \
  git clone https://github.com/tvheadend/tvheadend.git /tmp/tvheadend && \
  cd /tmp/tvheadend && \
  ./configure \
@@ -181,28 +179,10 @@ RUN \
 	--prefix=/usr \
 	--sysconfdir=/config && \
  make && \
- make install && \
- echo "**** build XMLTV ****" && \
- curl -o \
- /tmp/xmtltv-src.tar.bz2 -L \
-	"https://sourceforge.net/projects/xmltv/files/xmltv/${XMLTV_VER}/xmltv-${XMLTV_VER}.tar.bz2" && \
- tar xf \
- /tmp/xmtltv-src.tar.bz2 -C \
-	/tmp --strip-components=1 && \
- cd "/tmp/xmltv-${XMLTV_VER}" && \
- echo "**** Perl 5.26 fixes for XMTLV ****" && \
- sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_latex && \
- sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_text && \
- sed "s/\(lib\/set_share_dir.pl';\)/.\/\1/" -i grab/it/tv_grab_it.PL && \
- sed "s/\(filter\/Grep.pm';\)/.\/\1/" -i filter/tv_grep.PL && \
- sed "s/\(lib\/XMLTV.pm.in';\)/.\/\1/" -i lib/XMLTV.pm.PL && \
- sed "s/\(lib\/Ask\/Term.pm';\)/.\/\1/" -i Makefile.PL && \
- PERL5LIB=`pwd` && \
- echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor && \
- make && \
- make test && \
- make install && \
- echo "**** build argtable2 ****" && \
+ make DESTDIR=/tmp/tvheadend-build install
+
+RUN \
+ echo "**** compile argtable2 ****" && \
  ARGTABLE_VER1="${ARGTABLE_VER//./-}" && \
  mkdir -p \
 	/tmp/argtable && \
@@ -218,8 +198,12 @@ RUN \
 	--prefix=/usr && \
  make && \
  make check && \
- make install && \
- echo "***** build comskip ****" && \
+ make DESTDIR=/tmp/argtable-build install && \
+ echo "**** copy to /usr for comskip dependency ****" && \
+ cp -pr /tmp/argtable-build/usr/* /usr/
+
+RUN \
+ echo "***** compile comskip ****" && \
  git clone git://github.com/erikkaashoek/Comskip /tmp/comskip && \
  cd /tmp/comskip && \
  ./autogen.sh && \
@@ -227,15 +211,113 @@ RUN \
 	--bindir=/usr/bin \
 	--sysconfdir=/config/comskip && \
  make && \
- make install && \
- echo "***** cleanup ****" && \
- apk del --purge \
-	build-dependencies && \
- rm -rf \
-	/config/.cpanm \
-	/tmp/*
-
-# copy local files
+ make DESTDIR=/tmp/comskip-build install
+
+############## runtime stage ##############
+FROM lsiobase/alpine:3.8
+
+# set version label
+ARG BUILD_DATE
+ARG VERSION
+LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
+LABEL maintainer="saarg"
+
+# environment settings
+ENV HOME="/config"
+
+RUN \
+ echo "**** install runtime packages ****" && \
+ apk add --no-cache \
+	bsd-compat-headers \
+	bzip2 \
+	curl \
+	ffmpeg \
+	ffmpeg-libs \
+	gzip \
+	libcrypto1.0 \
+	libcurl \
+	libdvbcsa \
+	libhdhomerun-libs \
+	libssl1.0 \
+	libva \
+	libva-intel-driver \
+	libvpx \
+	libxml2 \
+	libxslt \
+	linux-headers \
+	openssl \
+	opus \
+	pcre2 \
+	perl \
+	perl-archive-zip \
+	perl-boolean \
+	perl-capture-tiny \
+	perl-cgi \
+	perl-compress-raw-zlib \
+	perl-data-dumper \
+	perl-date-manip \
+	perl-datetime \
+	perl-datetime-format-strptime \
+	perl-datetime-timezone \
+	perl-dbd-sqlite \
+	perl-dbi \
+	perl-digest-sha1 \
+	perl-doc \
+	perl-file-slurp \
+	perl-file-temp \
+	perl-file-which \
+	perl-getopt-long \
+	perl-html-parser \
+	perl-html-tree \
+	perl-http-cookies \
+	perl-io \
+	perl-io-compress \
+	perl-io-html \
+	perl-io-socket-ssl \
+	perl-io-stringy \
+	perl-json \
+	perl-libwww \
+	perl-lingua-en-numbers-ordinate \
+	perl-lingua-preferred \
+	perl-list-moreutils \
+	perl-module-build \
+	perl-module-pluggable \
+	perl-net-ssleay \
+	perl-parse-recdescent \
+	perl-path-class \
+	perl-scalar-list-utils \
+	perl-term-progressbar \
+	perl-term-readkey \
+	perl-test-exception \
+	perl-test-requires \
+	perl-timedate \
+	perl-try-tiny \
+	perl-unicode-string \
+	perl-xml-libxml \
+	perl-xml-libxslt \
+	perl-xml-parser \
+	perl-xml-sax \
+	perl-xml-treepp \
+	perl-xml-twig \
+	perl-xml-writer \
+	python \
+	tar \
+	uriparser \
+	wget \
+	x264 \
+	x265 \
+	zlib && \
+ apk add --no-cache \
+	--repository http://nl.alpinelinux.org/alpine/edge/testing \
+	gnu-libiconv
+
+# copy local files and buildstage artifacts
+COPY --from=buildstage /tmp/argtable-build/usr/ /usr/
+COPY --from=buildstage /tmp/comskip-build/usr/ /usr/
+COPY --from=buildstage /tmp/tvheadend-build/usr/ /usr/
+COPY --from=buildstage /tmp/xmltv-build/usr/ /usr/
+COPY --from=buildstage /usr/local/share/man/ /usr/local/share/man/
+COPY --from=buildstage /usr/local/share/perl5/ /usr/local/share/perl5/
 COPY root/ /
 
 # add picons

+ 1 - 0
README.md

@@ -162,6 +162,7 @@ You need to enable minimum advanced view level to see the picons options.
 
 ## Versions
 
++ **02.09.18:** Rebase to alpine 3.8 , use buildstage type build.
 + **21.04.18:** Add JSON::XS Perl package for grab_tv_huro.
 + **24.03.18:** Add dvbcsa package.
 + **04.03.18:** Use sourceforge master rather than mirror for xmltv.

+ 6 - 0
list

@@ -0,0 +1,6 @@
+COPY --from=buildstage /tmp/comskip-build/usr/ /usr/
+COPY --from=buildstage /tmp/argtable-build/usr/ /usr/
+COPY --from=buildstage /tmp/tvheadend-build/usr/ /usr/
+COPY --from=buildstage /tmp/xmltv-build/usr/ /usr/
+COPY --from=buildstage /usr/local/share/man/ /usr/local/share/man/
+COPY --from=buildstage /usr/local/share/perl5/ /usr/local/share/perl5/