fixing build logic to not full build ffmpeg for this branch and pushing to sources tag

This commit is contained in:
thelamer 2019-06-22 07:53:39 -07:00
parent 29b2a39146
commit 96b3a5f71b
7 changed files with 123 additions and 1555 deletions

View File

@ -1,20 +1,15 @@
FROM lsiobase/ubuntu:bionic as buildstage
FROM alpine:3.9 as fetch-stage
# set version label
ARG FFMPEG_VERSION
# common env
ENV \
DEBIAN_FRONTEND="noninteractive" \
MAKEFLAGS="-j4"
# environment variables
ARG SOURCE_FOLDER="/sources"
ARG TARS_FOLDER="/tmp/tarballs"
# versions
ENV \
AOM=v1.0.0 \
FDKAAC=0.1.5 \
FFMPEG_HARD=4.1.3 \
FONTCONFIG=2.13.91 \
FREETYPE=2.9.1 \
FREETYPE=2.8.1 \
FRIBIDI=0.19.7 \
KVAZAAR=1.2.0 \
LAME=3.99.5 \
@ -31,485 +26,97 @@ ENV \
THEORA=1.1.1 \
VORBIS=1.3.6 \
VPX=1.8.0 \
X264=last_stable_x264 \
X265=3.0 \
XVID=1.3.4
XVID=1.3.4
# urls for source codes not using git pull.
ARG NON_GIT_URL_LIST="\
https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC}.tar.gz \
https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG}.tar.bz2 \
https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz \
https://github.com/fribidi/fribidi/archive/${FRIBIDI}.tar.gz \
https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR}.tar.gz \
http://downloads.sourceforge.net/project/lame/lame/3.99/lame-${LAME}.tar.gz \
https://github.com/libass/libass/archive/${LIBASS}.tar.gz \
https://dri.freedesktop.org/libdrm/libdrm-${LIBDRM}.tar.gz \
https://github.com/intel/libva/archive/${LIBVA}.tar.gz \
http://downloads.xiph.org/releases/ogg/libogg-${OGG}.tar.gz \
http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR}.tar.gz \
https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG}.tar.gz \
https://archive.mozilla.org/pub/opus/opus-${OPUS}.tar.gz \
http://downloads.xiph.org/releases/theora/libtheora-${THEORA}.tar.gz \
https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB}.tar.gz \
http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS}.tar.gz \
https://github.com/webmproject/libvpx/archive/v${VPX}.tar.gz \
https://download.videolan.org/pub/videolan/x264/snapshots/${X264}.tar.bz2 \
https://download.videolan.org/pub/videolan/x265/x265_${X265}.tar.gz \
http://downloads.xvid.org/downloads/xvidcore-${XVID}.tar.gz"
# install fetch packages
RUN \
echo "**** install build packages ****" && \
apt-get update && \
apt-get install -y \
autoconf \
automake \
bzip2 \
ca-certificates \
cmake \
apk add --no-cache \
bash \
curl \
diffutils \
g++ \
gcc \
bzip2 \
git \
gperf \
libexpat1-dev \
libxext-dev \
libgcc-7-dev \
libgomp1 \
libpciaccess-dev \
libssl-dev \
libtool \
libv4l-dev \
libx11-dev \
libxml2-dev \
make \
nasm \
perl \
pkg-config \
python \
x11proto-xext-dev \
xserver-xorg-dev \
yasm \
zlib1g-dev
wget \
xz
# set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# compile 3rd party libs
# make folders
RUN \
echo "**** grabbing aom ****" && \
mkdir -p /tmp/aom && \
mkdir -p \
"${SOURCE_FOLDER}" \
${TARS_FOLDER}
RUN \
echo "\n**** fetch git based source codes ****" && \
git clone \
--branch ${AOM} \
--depth 1 https://aomedia.googlesource.com/aom \
/tmp/aom
RUN \
echo "**** compiling aom ****" && \
cd /tmp/aom && \
rm -rf \
CMakeCache.txt \
CMakeFiles && \
mkdir -p \
aom_build && \
cd aom_build && \
cmake \
-DBUILD_STATIC_LIBS=0 .. && \
make && \
make install
RUN \
echo "**** grabbing fdk-aac ****" && \
mkdir -p /tmp/fdk-aac && \
curl -Lf \
https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fdk-aac
RUN \
echo "**** compiling fdk-aac ****" && \
cd /tmp/fdk-aac && \
autoreconf -fiv && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing ffnvcodec ****" && \
mkdir -p /tmp/ffnvcodec && \
"${SOURCE_FOLDER}"/aom && \
git clone \
--branch ${NVCODEC} \
--depth 1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git \
/tmp/ffnvcodec
RUN \
echo "**** compiling ffnvcodec ****" && \
cd /tmp/ffnvcodec && \
make install
RUN \
echo "**** grabbing freetype ****" && \
mkdir -p /tmp/freetype && \
curl -Lf \
https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/freetype
RUN \
echo "**** compiling freetype ****" && \
cd /tmp/freetype && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing fontconfig ****" && \
mkdir -p /tmp/fontconfig && \
curl -Lf \
https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fontconfig
RUN \
echo "**** compiling fontconfig ****" && \
cd /tmp/fontconfig && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing fribidi ****" && \
mkdir -p /tmp/fribidi && \
curl -Lf \
https://github.com/fribidi/fribidi/archive/${FRIBIDI}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fribidi
RUN \
echo "**** compiling fribidi ****" && \
cd /tmp/fribidi && \
./bootstrap --no-config && \
./configure \
--disable-static \
--enable-shared && \
make -j 1 && \
make install
RUN \
echo "**** grabbing kvazaar ****" && \
mkdir -p /tmp/kvazaar && \
curl -Lf \
https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/kvazaar
RUN \
echo "**** compiling kvazaar ****" && \
cd /tmp/kvazaar && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing lame ****" && \
mkdir -p /tmp/lame && \
curl -Lf \
http://downloads.sourceforge.net/project/lame/lame/3.99/lame-${LAME}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/lame
RUN \
echo "**** compiling lame ****" && \
cd /tmp/lame && \
cp \
/usr/share/automake-1.15/config.guess \
config.guess && \
cp \
/usr/share/automake-1.15/config.sub \
config.sub && \
./configure \
--disable-frontend \
--disable-static \
--enable-nasm \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing libass ****" && \
mkdir -p /tmp/libass && \
curl -Lf \
https://github.com/libass/libass/archive/${LIBASS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/libass
RUN \
echo "**** compiling libass ****" && \
cd /tmp/libass && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing libdrm ****" && \
mkdir -p /tmp/libdrm && \
curl -Lf \
https://dri.freedesktop.org/libdrm/libdrm-${LIBDRM}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/libdrm
RUN \
echo "**** compiling libdrm ****" && \
cd /tmp/libdrm && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing libva ****" && \
mkdir -p /tmp/libva && \
curl -Lf \
https://github.com/intel/libva/archive/${LIBVA}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/libva
RUN \
echo "**** compiling libva ****" && \
cd /tmp/libva && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing libvdpau ****" && \
mkdir -p /tmp/libvdpau && \
"${SOURCE_FOLDER}"/ffnvcodec && \
git clone \
--branch libvdpau-${LIBVDPAU} \
--depth 1 https://gitlab.freedesktop.org/vdpau/libvdpau.git \
/tmp/libvdpau
RUN \
echo "**** compiling libvdpau ****" && \
cd /tmp/libvdpau && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing ogg ****" && \
mkdir -p /tmp/ogg && \
curl -Lf \
http://downloads.xiph.org/releases/ogg/libogg-${OGG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/ogg
RUN \
echo "**** compiling ogg ****" && \
cd /tmp/ogg && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing opencore-amr ****" && \
mkdir -p /tmp/opencore-amr && \
curl -Lf \
http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/opencore-amr
RUN \
echo "**** compiling opencore-amr ****" && \
cd /tmp/opencore-amr && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing openjpeg ****" && \
mkdir -p /tmp/openjpeg && \
curl -Lf \
https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/openjpeg
RUN \
echo "**** compiling openjpeg ****" && \
cd /tmp/openjpeg && \
rm -Rf \
thirdparty/libpng/* && \
curl -Lf \
https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz | \
tar -zx --strip-components=1 -C thirdparty/libpng/ && \
cmake \
-DBUILD_STATIC_LIBS=0 \
-DBUILD_THIRDPARTY:BOOL=ON . && \
make && \
make install
RUN \
echo "**** grabbing opus ****" && \
mkdir -p /tmp/opus && \
curl -Lf \
https://archive.mozilla.org/pub/opus/opus-${OPUS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/opus
RUN \
echo "**** compiling opus ****" && \
cd /tmp/opus && \
autoreconf -fiv && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing theora ****" && \
mkdir -p /tmp/theora && \
curl -Lf \
http://downloads.xiph.org/releases/theora/libtheora-${THEORA}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/theora
RUN \
echo "**** compiling theora ****" && \
cd /tmp/theora && \
cp \
/usr/share/automake-1.15/config.guess \
config.guess && \
cp \
/usr/share/automake-1.15/config.sub \
config.sub && \
curl -fL \
'https://git.xiph.org/?p=theora.git;a=commitdiff_plain;h=7288b539c52e99168488dc3a343845c9365617c8' \
> png.patch && \
patch ./examples/png2theora.c < png.patch && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing vid.stab ****" && \
mkdir -p /tmp/vid.stab && \
curl -Lf \
https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vid.stab
RUN \
echo "**** compiling vid.stab ****" && \
cd /tmp/vid.stab && \
cmake \
-DBUILD_STATIC_LIBS=0 . && \
make && \
make install
RUN \
echo "**** grabbing vorbis ****" && \
mkdir -p /tmp/vorbis && \
curl -Lf \
http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vorbis
RUN \
echo "**** compiling vorbis ****" && \
cd /tmp/vorbis && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing vpx ****" && \
mkdir -p /tmp/vpx && \
curl -Lf \
https://github.com/webmproject/libvpx/archive/v${VPX}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vpx
RUN \
echo "**** compiling vpx ****" && \
cd /tmp/vpx && \
./configure \
--disable-debug \
--disable-docs \
--disable-examples \
--disable-install-bins \
--disable-static \
--disable-unit-tests \
--enable-pic \
--enable-shared \
--enable-vp8 \
--enable-vp9 \
--enable-vp9-highbitdepth && \
make && \
make install
RUN \
echo "**** grabbing x264 ****" && \
mkdir -p /tmp/x264 && \
curl -Lf \
https://download.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2 | \
tar -jx --strip-components=1 -C /tmp/x264
RUN \
echo "**** compiling x264 ****" && \
cd /tmp/x264 && \
./configure \
--disable-cli \
--disable-static \
--enable-pic \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing x265 ****" && \
mkdir -p /tmp/x265 && \
curl -Lf \
https://download.videolan.org/pub/videolan/x265/x265_${X265}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/x265
RUN \
echo "**** compiling x265 ****" && \
cd /tmp/x265/build/linux && \
./multilib.sh && \
make -C 8bit install
RUN \
echo "**** grabbing xvid ****" && \
mkdir -p /tmp/xvid && \
curl -Lf \
http://downloads.xvid.org/downloads/xvidcore-${XVID}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/xvid
RUN \
echo "**** compiling xvid ****" && \
cd /tmp/xvid/build/generic && \
./configure && \
make && \
make install
# main ffmpeg build
RUN \
echo "**** Versioning ****" && \
if [ -z ${FFMPEG_VERSION+x} ]; then \
FFMPEG=${FFMPEG_HARD}; \
else \
FFMPEG=${FFMPEG_VERSION}; \
fi && \
echo "**** grabbing ffmpeg ****" && \
mkdir -p /tmp/ffmpeg && \
echo "https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2" && \
curl -Lf \
https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2 | \
tar -jx --strip-components=1 -C /tmp/ffmpeg
RUN \
echo "**** compiling ffmpeg ****" && \
cd /tmp/ffmpeg && \
./configure \
--disable-debug \
--disable-doc \
--disable-ffplay \
--disable-ffprobe \
--enable-avresample \
--enable-cuvid \
--enable-gpl \
--enable-libaom \
--enable-libass \
--enable-libfdk_aac \
--enable-libfreetype \
--enable-libkvazaar \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libopus \
--enable-libtheora \
--enable-libv4l2 \
--enable-libvidstab \
--enable-libvorbis \
--enable-libvpx \
--enable-libxml2 \
--enable-libx264 \
--enable-libx265 \
--enable-libxvid \
--enable-nonfree \
--enable-nvdec \
--enable-nvenc \
--enable-openssl \
--enable-small \
--enable-stripping \
--enable-vaapi \
--enable-vdpau \
--enable-version3 && \
make
RUN \
echo "**** arrange files ****" && \
ldconfig && \
mkdir -p /buildout/usr/local/bin && \
cp \
/tmp/ffmpeg/ffmpeg \
/buildout/usr/local/bin && \
mkdir -p /buildout/usr/lib && \
ldd /tmp/ffmpeg/ffmpeg \
| awk '/local/ {print $3}' \
| xargs -i cp -L {} /buildout/usr/lib/ && \
cp -a \
/usr/local/lib/libdrm_* \
/buildout/usr/lib/
# Storage layer consumed downstream
FROM scratch
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"
# Add files from buildstage
COPY --from=buildstage /buildout/ /
"${SOURCE_FOLDER}"/libvdpau && \
echo -e "\n**** fetch non-git source codes ****" && \
set -ex && \
echo -e "\n$NON_GIT_URL_LIST" | tr " " "\\n" >> /tmp/non_git_url_list && \
while read -r urls; do \
FILE_EXTENSION=$(echo "$urls" | sed 's/.*\///'); \
rm -f "${TARS_FOLDER}/${FILE_EXTENSION}"; \
curl -o \
"${TARS_FOLDER}/${FILE_EXTENSION}" -L -C - "$urls" \
--max-time 40 \
--retry 5 \
--retry-delay 3 \
--retry-max-time 240; \
tar xf "${TARS_FOLDER}/${FILE_EXTENSION}" -C "${SOURCE_FOLDER}"; \
done < /tmp/non_git_url_list && \
echo -e "\n**** fetch and apply config.sub and config.guess for issues with arm64 builds. ****" && \
curl -o "${TARS_FOLDER}/config.sub" -L -C - \
'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' \
--max-time 40 \
--retry 5 \
--retry-delay 3 \
--retry-max-time 240 && \
curl -o "${TARS_FOLDER}/config.guess" -L -C - \
'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' \
--max-time 40 \
--retry 5 \
--retry-delay 3 \
--retry-max-time 240 && \
set +ex && \
find "${SOURCE_FOLDER}"/ -name 'config.sub' -exec cp -v "${TARS_FOLDER}/config.sub" {} \; && \
find "${SOURCE_FOLDER}"/ -name 'config.guess' -exec cp -v "${TARS_FOLDER}/config.guess" {} \; && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*

View File

@ -1,453 +0,0 @@
FROM lsiobase/ubuntu:arm64v8-bionic as buildstage
# set version label
ARG FFMPEG_VERSION
# common env
ENV \
DEBIAN_FRONTEND="noninteractive" \
MAKEFLAGS="-j4"
# versions
ENV \
AOM=v1.0.0 \
FDKAAC=0.1.5 \
FFMPEG_HARD=4.1.3 \
FONTCONFIG=2.13.91 \
FREETYPE=2.8.1 \
FRIBIDI=0.19.7 \
KVAZAAR=1.2.0 \
LAME=3.99.5 \
LIBASS=0.14.0 \
LIBDRM=2.4.98 \
LIBVA=2.4.1 \
LIBVDPAU=1.2 \
LIBVIDSTAB=1.1.0 \
NVCODEC=n9.0.18.1 \
OGG=1.3.2 \
OPENCOREAMR=0.1.5 \
OPENJPEG=2.3.1 \
OPUS=1.3 \
THEORA=1.1.1 \
VORBIS=1.3.6 \
VPX=1.8.0 \
X265=3.0 \
XVID=1.3.4
RUN \
echo "**** install build packages ****" && \
apt-get update && \
apt-get install -y \
autoconf \
automake \
bzip2 \
ca-certificates \
cmake \
curl \
diffutils \
g++ \
gcc \
git \
gperf \
libexpat1-dev \
libxext-dev \
libgcc-7-dev \
libgomp1 \
libpciaccess-dev \
libssl-dev \
libtool \
libv4l-dev \
libx11-dev \
libxml2-dev \
make \
nasm \
perl \
pkg-config \
python \
x11proto-xext-dev \
xserver-xorg-dev \
yasm \
zlib1g-dev
# compile 3rd party libs
RUN \
echo "**** grabbing aom ****" && \
mkdir -p /tmp/aom && \
git clone \
--branch ${AOM} \
--depth 1 https://aomedia.googlesource.com/aom \
/tmp/aom
RUN \
echo "**** compiling aom ****" && \
cd /tmp/aom && \
rm -rf \
CMakeCache.txt \
CMakeFiles && \
mkdir -p \
aom_build && \
cd aom_build && \
cmake \
-DBUILD_STATIC_LIBS=0 .. && \
make && \
make install
RUN \
echo "**** grabbing fdk-aac ****" && \
mkdir -p /tmp/fdk-aac && \
curl -Lf \
https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fdk-aac
RUN \
echo "**** compiling fdk-aac ****" && \
cd /tmp/fdk-aac && \
autoreconf -fiv && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing freetype ****" && \
mkdir -p /tmp/freetype && \
curl -Lf \
https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/freetype
RUN \
echo "**** compiling freetype ****" && \
cd /tmp/freetype && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing fontconfig ****" && \
mkdir -p /tmp/fontconfig && \
curl -Lf \
https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fontconfig
RUN \
echo "**** compiling fontconfig ****" && \
cd /tmp/fontconfig && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing fribidi ****" && \
mkdir -p /tmp/fribidi && \
curl -Lf \
https://github.com/fribidi/fribidi/archive/${FRIBIDI}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fribidi
RUN \
echo "**** compiling fribidi ****" && \
cd /tmp/fribidi && \
./bootstrap --no-config && \
./configure \
--disable-static \
--enable-shared && \
make -j 1 && \
make install
RUN \
echo "**** grabbing kvazaar ****" && \
mkdir -p /tmp/kvazaar && \
curl -Lf \
https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/kvazaar
RUN \
echo "**** compiling kvazaar ****" && \
cd /tmp/kvazaar && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing lame ****" && \
mkdir -p /tmp/lame && \
curl -Lf \
http://downloads.sourceforge.net/project/lame/lame/3.99/lame-${LAME}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/lame
RUN \
echo "**** compiling lame ****" && \
cd /tmp/lame && \
cp \
/usr/share/automake-1.15/config.guess \
config.guess && \
cp \
/usr/share/automake-1.15/config.sub \
config.sub && \
./configure \
--disable-frontend \
--disable-static \
--enable-nasm \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing libass ****" && \
mkdir -p /tmp/libass && \
curl -Lf \
https://github.com/libass/libass/archive/${LIBASS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/libass
RUN \
echo "**** compiling libass ****" && \
cd /tmp/libass && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing ogg ****" && \
mkdir -p /tmp/ogg && \
curl -Lf \
http://downloads.xiph.org/releases/ogg/libogg-${OGG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/ogg
RUN \
echo "**** compiling ogg ****" && \
cd /tmp/ogg && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing opencore-amr ****" && \
mkdir -p /tmp/opencore-amr && \
curl -Lf \
http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/opencore-amr
RUN \
echo "**** compiling opencore-amr ****" && \
cd /tmp/opencore-amr && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing openjpeg ****" && \
mkdir -p /tmp/openjpeg && \
curl -Lf \
https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/openjpeg
RUN \
echo "**** compiling openjpeg ****" && \
cd /tmp/openjpeg && \
rm -Rf \
thirdparty/libpng/* && \
curl -Lf \
https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz | \
tar -zx --strip-components=1 -C thirdparty/libpng/ && \
cmake \
-DBUILD_STATIC_LIBS=0 \
-DBUILD_THIRDPARTY:BOOL=ON . && \
make && \
make install
RUN \
echo "**** grabbing opus ****" && \
mkdir -p /tmp/opus && \
curl -Lf \
https://archive.mozilla.org/pub/opus/opus-${OPUS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/opus
RUN \
echo "**** compiling opus ****" && \
cd /tmp/opus && \
autoreconf -fiv && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing theora ****" && \
mkdir -p /tmp/theora && \
curl -Lf \
http://downloads.xiph.org/releases/theora/libtheora-${THEORA}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/theora
RUN \
echo "**** compiling theora ****" && \
cd /tmp/theora && \
cp \
/usr/share/automake-1.15/config.guess \
config.guess && \
cp \
/usr/share/automake-1.15/config.sub \
config.sub && \
curl -fL \
'https://git.xiph.org/?p=theora.git;a=commitdiff_plain;h=7288b539c52e99168488dc3a343845c9365617c8' \
> png.patch && \
patch ./examples/png2theora.c < png.patch && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing vid.stab ****" && \
mkdir -p /tmp/vid.stab && \
curl -Lf \
https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vid.stab
RUN \
echo "**** compiling vid.stab ****" && \
cd /tmp/vid.stab && \
echo "" > \
CMakeModules/FindSSE.cmake && \
cmake . && \
make && \
make install
RUN \
echo "**** grabbing vorbis ****" && \
mkdir -p /tmp/vorbis && \
curl -Lf \
http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vorbis
RUN \
echo "**** compiling vorbis ****" && \
cd /tmp/vorbis && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing vpx ****" && \
mkdir -p /tmp/vpx && \
curl -Lf \
https://github.com/webmproject/libvpx/archive/v${VPX}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vpx
RUN \
echo "**** compiling vpx ****" && \
cd /tmp/vpx && \
./configure \
--disable-debug \
--disable-docs \
--disable-examples \
--disable-install-bins \
--disable-static \
--disable-unit-tests \
--enable-pic \
--enable-shared \
--enable-vp8 \
--enable-vp9 \
--enable-vp9-highbitdepth && \
make && \
make install
RUN \
echo "**** grabbing x264 ****" && \
mkdir -p /tmp/x264 && \
curl -Lf \
https://download.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2 | \
tar -jx --strip-components=1 -C /tmp/x264
RUN \
echo "**** compiling x264 ****" && \
cd /tmp/x264 && \
./configure \
--disable-cli \
--disable-static \
--enable-pic \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing x265 ****" && \
mkdir -p /tmp/x265 && \
curl -Lf \
https://download.videolan.org/pub/videolan/x265/x265_${X265}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/x265
RUN \
echo "**** compiling x265 ****" && \
cd /tmp/x265/build/linux && \
export CXXFLAGS="-fPIC" && \
./multilib.sh && \
make -C 8bit install
RUN \
echo "**** grabbing xvid ****" && \
mkdir -p /tmp/xvid && \
curl -Lf \
http://downloads.xvid.org/downloads/xvidcore-${XVID}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/xvid
RUN \
echo "**** compiling xvid ****" && \
cd /tmp/xvid/build/generic && \
./configure && \
make && \
make install
# main ffmpeg build
RUN \
echo "**** Versioning ****" && \
if [ -z ${FFMPEG_VERSION+x} ]; then \
FFMPEG=${FFMPEG_HARD}; \
else \
FFMPEG=${FFMPEG_VERSION}; \
fi && \
echo "**** grabbing ffmpeg ****" && \
mkdir -p /tmp/ffmpeg && \
echo "https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2" && \
curl -Lf \
https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2 | \
tar -jx --strip-components=1 -C /tmp/ffmpeg
RUN \
echo "**** compiling ffmpeg ****" && \
cd /tmp/ffmpeg && \
./configure \
--disable-debug \
--disable-doc \
--disable-ffplay \
--disable-ffprobe \
--enable-avresample \
--enable-gpl \
--enable-libaom \
--enable-libass \
--enable-libfdk_aac \
--enable-libfreetype \
--enable-libkvazaar \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libopus \
--enable-libtheora \
--enable-libv4l2 \
--enable-libvidstab \
--enable-libvorbis \
--enable-libvpx \
--enable-libxml2 \
--enable-libx264 \
--enable-libx265 \
--enable-libxvid \
--enable-nonfree \
--enable-openssl \
--enable-small \
--enable-stripping \
--enable-version3 && \
make
RUN \
echo "**** arrange files ****" && \
ldconfig && \
mkdir -p /buildout/usr/local/bin && \
cp \
/tmp/ffmpeg/ffmpeg \
/buildout/usr/local/bin && \
mkdir -p /buildout/usr/lib && \
ldd /tmp/ffmpeg/ffmpeg \
| awk '/local/ {print $3}' \
| xargs -i cp -L {} /buildout/usr/lib/
# Storage layer consumed downstream
FROM scratch
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"
# Add files from buildstage
COPY --from=buildstage /buildout/ /

View File

@ -1,463 +0,0 @@
FROM lsiobase/ubuntu:arm32v7-bionic as buildstage
# set version label
ARG FFMPEG_VERSION
# common env
ENV \
DEBIAN_FRONTEND="noninteractive" \
MAKEFLAGS="-j4"
# versions
ENV \
AOM=v1.0.0 \
FDKAAC=0.1.5 \
FFMPEG_HARD=4.1.3 \
FONTCONFIG=2.13.91 \
FREETYPE=2.8.1 \
FRIBIDI=0.19.7 \
KVAZAAR=1.2.0 \
LAME=3.99.5 \
LIBASS=0.14.0 \
LIBDRM=2.4.98 \
LIBVA=2.4.1 \
LIBVDPAU=1.2 \
LIBVIDSTAB=1.1.0 \
NVCODEC=n9.0.18.1 \
OGG=1.3.2 \
OPENCOREAMR=0.1.5 \
OPENJPEG=2.3.1 \
OPUS=1.3 \
THEORA=1.1.1 \
VORBIS=1.3.6 \
VPX=1.8.0 \
X265=3.0 \
XVID=1.3.4
RUN \
echo "**** install build packages ****" && \
apt-get update && \
apt-get install -y \
autoconf \
automake \
bzip2 \
ca-certificates \
cmake \
curl \
diffutils \
g++ \
gcc \
git \
gperf \
libexpat1-dev \
libxext-dev \
libgcc-7-dev \
libgomp1 \
libpciaccess-dev \
libssl-dev \
libtool \
libv4l-dev \
libx11-dev \
libxml2-dev \
make \
nasm \
perl \
pkg-config \
python \
x11proto-xext-dev \
xserver-xorg-dev \
yasm \
zlib1g-dev
# compile 3rd party libs
RUN \
echo "**** grabbing aom ****" && \
mkdir -p /tmp/aom && \
git clone \
--branch ${AOM} \
--depth 1 https://aomedia.googlesource.com/aom \
/tmp/aom
RUN \
echo "**** compiling aom ****" && \
cd /tmp/aom && \
rm -rf \
CMakeCache.txt \
CMakeFiles && \
mkdir -p \
aom_build && \
cd aom_build && \
cmake \
-DAOM_TARGET_CPU=generic \
-DBUILD_STATIC_LIBS=0 .. && \
make && \
make install
RUN \
echo "**** grabbing fdk-aac ****" && \
mkdir -p /tmp/fdk-aac && \
curl -Lf \
https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fdk-aac
RUN \
echo "**** compiling fdk-aac ****" && \
cd /tmp/fdk-aac && \
autoreconf -fiv && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing freetype ****" && \
mkdir -p /tmp/freetype && \
curl -Lf \
https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/freetype
RUN \
echo "**** compiling freetype ****" && \
cd /tmp/freetype && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing fontconfig ****" && \
mkdir -p /tmp/fontconfig && \
curl -Lf \
https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fontconfig
RUN \
echo "**** compiling fontconfig ****" && \
cd /tmp/fontconfig && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing fribidi ****" && \
mkdir -p /tmp/fribidi && \
curl -Lf \
https://github.com/fribidi/fribidi/archive/${FRIBIDI}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/fribidi
RUN \
echo "**** compiling fribidi ****" && \
cd /tmp/fribidi && \
./bootstrap --no-config && \
./configure \
--disable-static \
--enable-shared && \
make -j 1 && \
make install
RUN \
echo "**** grabbing kvazaar ****" && \
mkdir -p /tmp/kvazaar && \
curl -Lf \
https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/kvazaar
RUN \
echo "**** compiling kvazaar ****" && \
cd /tmp/kvazaar && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing lame ****" && \
mkdir -p /tmp/lame && \
curl -Lf \
http://downloads.sourceforge.net/project/lame/lame/3.99/lame-${LAME}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/lame
RUN \
echo "**** compiling lame ****" && \
cd /tmp/lame && \
cp \
/usr/share/automake-1.15/config.guess \
config.guess && \
cp \
/usr/share/automake-1.15/config.sub \
config.sub && \
./configure \
--disable-frontend \
--disable-static \
--enable-nasm \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing libass ****" && \
mkdir -p /tmp/libass && \
curl -Lf \
https://github.com/libass/libass/archive/${LIBASS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/libass
RUN \
echo "**** compiling libass ****" && \
cd /tmp/libass && \
./autogen.sh && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing ogg ****" && \
mkdir -p /tmp/ogg && \
curl -Lf \
http://downloads.xiph.org/releases/ogg/libogg-${OGG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/ogg
RUN \
echo "**** compiling ogg ****" && \
cd /tmp/ogg && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing opencore-amr ****" && \
mkdir -p /tmp/opencore-amr && \
curl -Lf \
http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/opencore-amr
RUN \
echo "**** compiling opencore-amr ****" && \
cd /tmp/opencore-amr && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing openjpeg ****" && \
mkdir -p /tmp/openjpeg && \
curl -Lf \
https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/openjpeg
RUN \
echo "**** compiling openjpeg ****" && \
cd /tmp/openjpeg && \
rm -Rf \
thirdparty/libpng/* && \
curl -Lf \
https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz | \
tar -zx --strip-components=1 -C thirdparty/libpng/ && \
cmake \
-DBUILD_STATIC_LIBS=0 \
-DBUILD_THIRDPARTY:BOOL=ON . && \
make && \
make install
RUN \
echo "**** grabbing opus ****" && \
mkdir -p /tmp/opus && \
curl -Lf \
https://archive.mozilla.org/pub/opus/opus-${OPUS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/opus
RUN \
echo "**** compiling opus ****" && \
cd /tmp/opus && \
autoreconf -fiv && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing theora ****" && \
mkdir -p /tmp/theora && \
curl -Lf \
http://downloads.xiph.org/releases/theora/libtheora-${THEORA}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/theora
RUN \
echo "**** compiling theora ****" && \
cd /tmp/theora && \
cp \
/usr/share/automake-1.15/config.guess \
config.guess && \
cp \
/usr/share/automake-1.15/config.sub \
config.sub && \
curl -fL \
'https://git.xiph.org/?p=theora.git;a=commitdiff_plain;h=7288b539c52e99168488dc3a343845c9365617c8' \
> png.patch && \
patch ./examples/png2theora.c < png.patch && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing vid.stab ****" && \
mkdir -p /tmp/vid.stab && \
curl -Lf \
https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vid.stab
RUN \
echo "**** compiling vid.stab ****" && \
cd /tmp/vid.stab && \
echo "" > \
CMakeModules/FindSSE.cmake && \
cmake . && \
make && \
make install
RUN \
echo "**** grabbing vorbis ****" && \
mkdir -p /tmp/vorbis && \
curl -Lf \
http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vorbis
RUN \
echo "**** compiling vorbis ****" && \
cd /tmp/vorbis && \
./configure \
--disable-static \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing vpx ****" && \
mkdir -p /tmp/vpx && \
curl -Lf \
https://github.com/webmproject/libvpx/archive/v${VPX}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/vpx
RUN \
echo "**** compiling vpx ****" && \
cd /tmp/vpx && \
LDFLAGS=-mfloat-abi=hard ./configure \
--disable-debug \
--disable-docs \
--disable-examples \
--disable-install-bins \
--disable-static \
--disable-unit-tests \
--enable-pic \
--enable-shared \
--enable-vp8 \
--enable-vp9 \
--enable-vp9-highbitdepth \
--extra-cflags="-mfloat-abi=hard" \
--extra-cxxflags="-mfloat-abi=hard" && \
make && \
make install
RUN \
echo "**** grabbing x264 ****" && \
mkdir -p /tmp/x264 && \
curl -Lf \
https://download.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2 | \
tar -jx --strip-components=1 -C /tmp/x264
RUN \
echo "**** compiling x264 ****" && \
cd /tmp/x264 && \
./configure \
--disable-cli \
--disable-static \
--enable-pic \
--enable-shared && \
make && \
make install
RUN \
echo "**** grabbing x265 ****" && \
mkdir -p /tmp/x265 && \
curl -Lf \
https://download.videolan.org/pub/videolan/x265/x265_${X265}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/x265
RUN \
echo "**** compiling x265 ****" && \
cd /tmp/x265/build/linux && \
curl -fL \
https://sources.debian.org/data/main/x/x265/3.0-2/debian/patches/0001-Fix-arm-flags.patch \
> arm.patch && \
patch ../../source/CMakeLists.txt < arm.patch && \
cmake \
-D ENABLE_ASSEMBLY=OFF \
-D ENABLE_CLI=OFF \
-G "Unix Makefiles" ../../source && \
make && \
make install
RUN \
echo "**** grabbing xvid ****" && \
mkdir -p /tmp/xvid && \
curl -Lf \
http://downloads.xvid.org/downloads/xvidcore-${XVID}.tar.gz | \
tar -zx --strip-components=1 -C /tmp/xvid
RUN \
echo "**** compiling xvid ****" && \
cd /tmp/xvid/build/generic && \
./configure && \
make && \
make install
# main ffmpeg build
RUN \
echo "**** Versioning ****" && \
if [ -z ${FFMPEG_VERSION+x} ]; then \
FFMPEG=${FFMPEG_HARD}; \
else \
FFMPEG=${FFMPEG_VERSION}; \
fi && \
echo "**** grabbing ffmpeg ****" && \
mkdir -p /tmp/ffmpeg && \
echo "https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2" && \
curl -Lf \
https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2 | \
tar -jx --strip-components=1 -C /tmp/ffmpeg
RUN \
echo "**** compiling ffmpeg ****" && \
cd /tmp/ffmpeg && \
./configure \
--disable-debug \
--disable-doc \
--disable-ffplay \
--disable-ffprobe \
--enable-avresample \
--enable-gpl \
--enable-libaom \
--enable-libass \
--enable-libfdk_aac \
--enable-libfreetype \
--enable-libkvazaar \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libopus \
--enable-libtheora \
--enable-libv4l2 \
--enable-libvidstab \
--enable-libvorbis \
--enable-libvpx \
--enable-libxml2 \
--enable-libx264 \
--enable-libx265 \
--enable-libxvid \
--enable-nonfree \
--enable-openssl \
--enable-small \
--enable-stripping \
--enable-version3 && \
make
RUN \
echo "**** arrange files ****" && \
ldconfig && \
mkdir -p /buildout/usr/local/bin && \
cp \
/tmp/ffmpeg/ffmpeg \
/buildout/usr/local/bin && \
mkdir -p /buildout/usr/lib && \
ldd /tmp/ffmpeg/ffmpeg \
| awk '/local/ {print $3}' \
| xargs -i cp -L {} /buildout/usr/lib/
# Storage layer consumed downstream
FROM scratch
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"
# Add files from buildstage
COPY --from=buildstage /buildout/ /

View File

@ -1,122 +0,0 @@
FROM alpine:3.9 as fetch-stage
# environment variables
ARG SOURCE_FOLDER="/sources"
ARG TARS_FOLDER="/tmp/tarballs"
# versions
ENV \
AOM=v1.0.0 \
FDKAAC=0.1.5 \
FONTCONFIG=2.13.91 \
FREETYPE=2.9.1 \
FRIBIDI=0.19.7 \
KVAZAAR=1.2.0 \
LAME=3.99.5 \
LIBASS=0.14.0 \
LIBDRM=2.4.98 \
LIBVA=2.4.1 \
LIBVDPAU=1.2 \
LIBVIDSTAB=1.1.0 \
NVCODEC=n9.0.18.1 \
OGG=1.3.2 \
OPENCOREAMR=0.1.5 \
OPENJPEG=2.3.1 \
OPUS=1.3 \
THEORA=1.1.1 \
VORBIS=1.3.6 \
VPX=1.8.0 \
X264=last_stable_x264 \
X265=3.0 \
XVID=1.3.4
# urls for source codes not using git pull.
ARG NON_GIT_URL_LIST="\
https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC}.tar.gz \
https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG}.tar.bz2 \
https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE}.tar.gz \
https://github.com/fribidi/fribidi/archive/${FRIBIDI}.tar.gz \
https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR}.tar.gz \
http://downloads.sourceforge.net/project/lame/lame/3.99/lame-${LAME}.tar.gz \
https://github.com/libass/libass/archive/${LIBASS}.tar.gz \
https://dri.freedesktop.org/libdrm/libdrm-${LIBDRM}.tar.gz \
https://github.com/intel/libva/archive/${LIBVA}.tar.gz \
http://downloads.xiph.org/releases/ogg/libogg-${OGG}.tar.gz \
http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR}.tar.gz \
https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG}.tar.gz \
https://archive.mozilla.org/pub/opus/opus-${OPUS}.tar.gz \
http://downloads.xiph.org/releases/theora/libtheora-${THEORA}.tar.gz \
https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB}.tar.gz \
http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS}.tar.gz \
https://github.com/webmproject/libvpx/archive/v${VPX}.tar.gz \
https://download.videolan.org/pub/videolan/x264/snapshots/${X264}.tar.bz2 \
https://download.videolan.org/pub/videolan/x265/x265_${X265}.tar.gz \
http://downloads.xvid.org/downloads/xvidcore-${XVID}.tar.gz"
# install fetch packages
RUN \
apk add --no-cache \
bash \
curl \
bzip2 \
git \
wget \
xz
# set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# make folders
RUN \
mkdir -p \
"${SOURCE_FOLDER}" \
${TARS_FOLDER}
RUN \
echo "\n**** fetch git based source codes ****" && \
git clone \
--branch ${AOM} \
--depth 1 https://aomedia.googlesource.com/aom \
"${SOURCE_FOLDER}"/aom && \
git clone \
--branch ${NVCODEC} \
--depth 1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git \
"${SOURCE_FOLDER}"/ffnvcodec && \
git clone \
--branch libvdpau-${LIBVDPAU} \
--depth 1 https://gitlab.freedesktop.org/vdpau/libvdpau.git \
"${SOURCE_FOLDER}"/libvdpau && \
echo -e "\n**** fetch non-git source codes ****" && \
set -ex && \
echo -e "\n$NON_GIT_URL_LIST" | tr " " "\\n" >> /tmp/non_git_url_list && \
while read -r urls; do \
FILE_EXTENSION=$(echo "$urls" | sed 's/.*\///'); \
rm -f "${TARS_FOLDER}/${FILE_EXTENSION}"; \
curl -o \
"${TARS_FOLDER}/${FILE_EXTENSION}" -L -C - "$urls" \
--max-time 40 \
--retry 5 \
--retry-delay 3 \
--retry-max-time 240; \
tar xf "${TARS_FOLDER}/${FILE_EXTENSION}" -C "${SOURCE_FOLDER}"; \
done < /tmp/non_git_url_list && \
echo -e "\n**** fetch and apply config.sub and config.guess for issues with arm64 builds. ****" && \
curl -o "${TARS_FOLDER}/config.sub" -L -C - \
'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' \
--max-time 40 \
--retry 5 \
--retry-delay 3 \
--retry-max-time 240 && \
curl -o "${TARS_FOLDER}/config.guess" -L -C - \
'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' \
--max-time 40 \
--retry 5 \
--retry-delay 3 \
--retry-max-time 240 && \
set +ex && \
find "${SOURCE_FOLDER}"/ -name 'config.sub' -exec cp -v "${TARS_FOLDER}/config.sub" {} \; && \
find "${SOURCE_FOLDER}"/ -name 'config.guess' -exec cp -v "${TARS_FOLDER}/config.guess" {} \; && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*

68
Jenkinsfile vendored
View File

@ -17,8 +17,8 @@ pipeline {
DOCKERHUB_IMAGE = 'lsiobase/ffmpeg'
DEV_DOCKERHUB_IMAGE = 'lsiodev/ffmpeg'
PR_DOCKERHUB_IMAGE = 'lspipepr/ffmpeg'
DIST_IMAGE = 'ubuntu'
MULTIARCH='true'
DIST_IMAGE = 'alpine'
MULTIARCH='false'
CI='false'
}
stages {
@ -28,7 +28,7 @@ pipeline {
script{
env.EXIT_STATUS = ''
env.LS_RELEASE = sh(
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':bin 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':sources 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
returnStdout: true).trim()
env.LS_RELEASE_NOTES = sh(
script: '''cat readme-vars.yml | awk -F \\" '/date: "[0-9][0-9].[0-9][0-9].[0-9][0-9]:/ {print $4;exit;}' | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''',
@ -97,7 +97,7 @@ pipeline {
steps{
script{
env.EXT_RELEASE = sh(
script: ''' echo 4.1.3 ''',
script: ''' echo 4.1.3_source ''',
returnStdout: true).trim()
env.RELEASE_LINK = 'custom_command'
}
@ -113,10 +113,10 @@ pipeline {
}
}
}
// If this is a bin build use live docker endpoints
// If this is a fetch_stage build use live docker endpoints
stage("Set ENV live build"){
when {
branch "bin"
branch "fetch_stage"
environment name: 'CHANGE_ID', value: ''
}
steps {
@ -134,7 +134,7 @@ pipeline {
// If this is a dev build use dev docker endpoints
stage("Set ENV dev build"){
when {
not {branch "bin"}
not {branch "fetch_stage"}
environment name: 'CHANGE_ID', value: ''
}
steps {
@ -201,7 +201,7 @@ pipeline {
// Use helper containers to render templated files
stage('Update-Templates') {
when {
branch "bin"
branch "fetch_stage"
environment name: 'CHANGE_ID', value: ''
expression {
env.CONTAINER_NAME != null
@ -212,15 +212,15 @@ pipeline {
set -e
TEMPDIR=$(mktemp -d)
docker pull linuxserver/jenkins-builder:latest
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=bin -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=fetch_stage -v ${TEMPDIR}:/ansible/jenkins linuxserver/jenkins-builder:latest
docker pull linuxserver/doc-builder:latest
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=bin -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=fetch_stage -v ${TEMPDIR}:/ansible/readme linuxserver/doc-builder:latest
if [ "$(md5sum ${TEMPDIR}/${LS_REPO}/Jenkinsfile | awk '{ print $1 }')" != "$(md5sum Jenkinsfile | awk '{ print $1 }')" ] || \
[ "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/README.md | awk '{ print $1 }')" != "$(md5sum README.md | awk '{ print $1 }')" ] || \
[ "$(cat ${TEMPDIR}/${LS_REPO}/LICENSE | md5sum | cut -c1-8)" != "${LICENSE_TAG}" ]; then
mkdir -p ${TEMPDIR}/repo
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git checkout -f bin
git --git-dir ${TEMPDIR}/repo/${LS_REPO}/.git checkout -f fetch_stage
cp ${TEMPDIR}/${CONTAINER_NAME}/README.md ${TEMPDIR}/repo/${LS_REPO}/
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/LICENSE ${TEMPDIR}/repo/${LS_REPO}/
@ -252,7 +252,7 @@ pipeline {
// Exit the build if the Templated files were just updated
stage('Template-exit') {
when {
branch "bin"
branch "fetch_stage"
environment name: 'CHANGE_ID', value: ''
environment name: 'FILES_UPDATED', value: 'true'
expression {
@ -294,7 +294,7 @@ pipeline {
}
stage('Build ARMHF') {
agent {
label 'X86-64-MULTI'
label 'ARMHF'
}
steps {
withCredentials([
@ -321,7 +321,7 @@ pipeline {
}
stage('Build ARM64') {
agent {
label 'X86-64-MULTI'
label 'ARM64'
}
steps {
withCredentials([
@ -419,12 +419,12 @@ pipeline {
sh '''#! /bin/bash
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
'''
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:bin"
sh "docker push ${IMAGE}:bin"
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:sources"
sh "docker push ${IMAGE}:sources"
sh "docker push ${IMAGE}:${META_TAG}"
sh '''docker rmi \
${IMAGE}:${META_TAG} \
${IMAGE}:bin || :'''
${IMAGE}:sources || :'''
}
}
@ -454,32 +454,32 @@ pipeline {
docker tag lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
docker tag lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
fi'''
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-bin"
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm32v7-bin"
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-bin"
sh "docker tag ${IMAGE}:amd64-${META_TAG} ${IMAGE}:amd64-sources"
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm32v7-sources"
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ${IMAGE}:arm64v8-sources"
sh "docker push ${IMAGE}:amd64-${META_TAG}"
sh "docker push ${IMAGE}:arm32v7-${META_TAG}"
sh "docker push ${IMAGE}:arm64v8-${META_TAG}"
sh "docker push ${IMAGE}:amd64-bin"
sh "docker push ${IMAGE}:arm32v7-bin"
sh "docker push ${IMAGE}:arm64v8-bin"
sh "docker manifest push --purge ${IMAGE}:bin || :"
sh "docker manifest create ${IMAGE}:bin ${IMAGE}:amd64-bin ${IMAGE}:arm32v7-bin ${IMAGE}:arm64v8-bin"
sh "docker manifest annotate ${IMAGE}:bin ${IMAGE}:arm32v7-bin --os linux --arch arm"
sh "docker manifest annotate ${IMAGE}:bin ${IMAGE}:arm64v8-bin --os linux --arch arm64 --variant v8"
sh "docker push ${IMAGE}:amd64-sources"
sh "docker push ${IMAGE}:arm32v7-sources"
sh "docker push ${IMAGE}:arm64v8-sources"
sh "docker manifest push --purge ${IMAGE}:sources || :"
sh "docker manifest create ${IMAGE}:sources ${IMAGE}:amd64-sources ${IMAGE}:arm32v7-sources ${IMAGE}:arm64v8-sources"
sh "docker manifest annotate ${IMAGE}:sources ${IMAGE}:arm32v7-sources --os linux --arch arm"
sh "docker manifest annotate ${IMAGE}:sources ${IMAGE}:arm64v8-sources --os linux --arch arm64 --variant v8"
sh "docker manifest push --purge ${IMAGE}:${META_TAG} || :"
sh "docker manifest create ${IMAGE}:${META_TAG} ${IMAGE}:amd64-${META_TAG} ${IMAGE}:arm32v7-${META_TAG} ${IMAGE}:arm64v8-${META_TAG}"
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm32v7-${META_TAG} --os linux --arch arm"
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8"
sh "docker manifest push --purge ${IMAGE}:bin"
sh "docker manifest push --purge ${IMAGE}:sources"
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
sh '''docker rmi \
${IMAGE}:amd64-${META_TAG} \
${IMAGE}:amd64-bin \
${IMAGE}:amd64-sources \
${IMAGE}:arm32v7-${META_TAG} \
${IMAGE}:arm32v7-bin \
${IMAGE}:arm32v7-sources \
${IMAGE}:arm64v8-${META_TAG} \
${IMAGE}:arm64v8-bin \
${IMAGE}:arm64v8-sources \
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
}
@ -488,7 +488,7 @@ pipeline {
// If this is a public release tag it in the LS Github
stage('Github-Tag-Push-Release') {
when {
branch "bin"
branch "fetch_stage"
expression {
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
}
@ -500,14 +500,14 @@ pipeline {
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"object": "'${COMMIT_SHA}'",\
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to bin",\
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to fetch_stage",\
"type": "commit",\
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
echo "Pushing New release for Tag"
sh '''#! /bin/bash
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"target_commitish": "bin",\
"target_commitish": "fetch_stage",\
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start
printf '","draft": false,"prerelease": true}' >> releasebody.json

View File

@ -3,12 +3,11 @@
# jenkins variables
project_name: docker-ffmpeg
external_type: na
custom_version_command: "echo 4.1.3"
custom_version_command: "echo 4.1.3_sources"
release_type: prerelease
release_tag: bin
ls_branch: bin
release_tag: sources
ls_branch: fetch_stage
skip_package_check: true
use_qemu: true
repo_vars:
- BUILD_VERSION_ARG = 'FFMPEG_VERSION'
- LS_USER = 'linuxserver'
@ -17,6 +16,6 @@ repo_vars:
- DOCKERHUB_IMAGE = 'lsiobase/ffmpeg'
- DEV_DOCKERHUB_IMAGE = 'lsiodev/ffmpeg'
- PR_DOCKERHUB_IMAGE = 'lspipepr/ffmpeg'
- DIST_IMAGE = 'ubuntu'
- MULTIARCH='true'
- DIST_IMAGE = 'alpine'
- MULTIARCH='false'
- CI='false'

View File

@ -19,7 +19,7 @@ full_custom_readme: |
&nbsp;
&nbsp;
This is an internal image layer used for downstream images needing dynamically linked ffmpeg.
This is an internal image layer used for downstream images needing ffmpeg sources.
The following line is only in this repo for loop testing: