anchor.diff:  RUN git clone https://github.com/uclouvain/openjpeg.git --branch master --single-branch \
   	&& cd openjpeg \
   	&& cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . \
  -	&& make -j "${NUM_CORES}" \
  -	&& make install \
  -	&& make clean
  -
  -# libx265
  -RUN git clone https://github.com/videolan/x265.git --branch master --single-branch \
  -	&& cd ./x265/build/linux \
  -	&& cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DENABLE_SHARED:bool=off ../../source \
  -	&& make -j "${NUM_CORES}" \
  -	&& make install \
  -	&& make clean
  -
  -# fribidi
  -RUN git clone https://github.com/fribidi/fribidi.git --branch master --single-branch \
  -	&& cd fribidi \
  -	&& sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib/' Makefile.am \
  -	&& ./bootstrap --no-config \
  -	&& ./configure -prefix="${PREFIX}" --enable-static=yes --enable-shared=no \
   	&& make -j "${NUM_CORES}" \
   	&& make install \
   	&& make clean
  
positive.code: FROM debian AS build
  
  ARG NUM_CORES=2
  
  ENV \
  	PREFIX="/tmp/ffmpeg_build" \
  	PKG_CONFIG_PATH="/tmp/ffmpeg_build/lib/pkgconfig"
  
  # Dependencies
  RUN apt-get update -qq \
  	&& apt-get -y install \
  		autoconf \
  		automake \
  		build-essential \
  		cmake \
  		git \
  		libass-dev \
  		libfreetype6-dev \
  		libsdl2-dev \
  		libtheora-dev \
  		libtool \
  		libva-dev \
  		libvdpau-dev \
  		libvorbis-dev \
  		libxcb1-dev \
  		libxcb-shm0-dev \
  		libxcb-xfixes0-dev \
  		mercurial \
  		pkg-config \
  		texinfo \
  		wget \
  		zlib1g-dev \
  		fontconfig \
  		frei0r-plugins-dev \
  		libass-dev \
  		libfontconfig1-dev \
  		libmp3lame-dev \
  		libopencore-amrnb-dev \
  		libopencore-amrwb-dev \
  		libopus-dev \
  		libspeex-dev \
  		libtheora-dev \
  		libvorbis-dev \
  		libvo-amrwbenc-dev \
  		libwebp-dev \
  		libx264-dev \
  		libnuma-dev \
  		libvpx-dev \
  		libxvidcore-dev \
  		texinfo \
  		yasm \
  	&& apt-get clean \
  	&& apt-get autoremove -y \
  	&& rm -rf /var/lib/apt/lists/*
  
negative.code: 	&& make clean
  
  # FFmpeg
  RUN git clone https://github.com/ffmpeg/ffmpeg.git --branch master --single-branch
  RUN export \
  		BIN_DIR="/opt/ffmpeg/bin" \
  		PATH="${BIN_DIR}:${PATH}" \
  	&& cd ./ffmpeg \
  	&& ./configure \
  		--cc=gcc \
  		--prefix="${PREFIX}" \
  		--pkg-config="pkg-config --static" \
  		--extra-cflags="-I${PREFIX}/include -static" \
  		--extra-ldflags="-L${PREFIX}/lib -static" \
  		--extra-libs="-lpthread -lm" \
  