diff --git a/Dockerfile b/Dockerfile index fd8d74e..149e35b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM emscripten/emsdk:3.1.15 as build -ARG FFMPEG_VERSION=4.3.1 -ARG X264_VERSION=20170226-2245-stable +ARG FFMPEG_VERSION=8.0.1 +ARG X264_COMMIT=b35605a ARG LAME_VERSION=3.100 ARG PREFIX=/opt/ffmpeg @@ -10,11 +10,13 @@ ARG MAKEFLAGS="-j4" RUN apt-get update && apt-get install -y autoconf libtool build-essential # libx264 -RUN cd /tmp && \ - wget https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 && \ - tar xvfj x264-snapshot-${X264_VERSION}.tar.bz2 +WORKDIR /tmp/ -RUN cd /tmp/x264-snapshot-${X264_VERSION} && \ +RUN git clone https://code.videolan.org/videolan/x264.git + +WORKDIR /tmp/x264 + +RUN git checkout ${X264_COMMIT} && \ emconfigure ./configure \ --prefix=${PREFIX} \ --host=i686-gnu \ @@ -23,35 +25,34 @@ RUN cd /tmp/x264-snapshot-${X264_VERSION} && \ --disable-asm \ --extra-cflags="-s USE_PTHREADS=1" -RUN cd /tmp/x264-snapshot-${X264_VERSION} && \ - emmake make && emmake make install +RUN "emmake make && emmake make install" +WORKDIR /tmp/ # libmp3lame -RUN cd /tmp && \ - wget -O lame-${LAME_VERSION}.tar.gz https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download && \ - tar zxf lame-${LAME_VERSION}.tar.gz +RUN wget -O lame-${LAME_VERSION}.tar.gz https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download && \ + tar zxf lame-${LAME_VERSION}.tar.gz && rm lame-${LAME_VERSION}.tar.gz -RUN cd /tmp/lame-${LAME_VERSION} && \ - emconfigure ./configure \ +WORKDIR /tmp/lame-${LAME_VERSION} +RUN emconfigure ./configure \ --prefix=${PREFIX} \ --host=i686-gnu \ --enable-static \ --disable-frontend -RUN cd /tmp/lame-${LAME_VERSION} && \ - emmake make && emmake make install +WORKDIR /tmp/lame-${LAME_VERSION} +RUN emmake make && emmake make install # Get ffmpeg source. -RUN cd /tmp/ && \ - wget http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ +WORKDIR /tmp/ +RUN wget -O ffmpeg-${FFMPEG_VERSION}.tar.gz http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ tar zxf ffmpeg-${FFMPEG_VERSION}.tar.gz && rm ffmpeg-${FFMPEG_VERSION}.tar.gz ARG CFLAGS="-s USE_PTHREADS=1 -O3 -I${PREFIX}/include" ARG LDFLAGS="$CFLAGS -L${PREFIX}/lib -s INITIAL_MEMORY=33554432" # Compile ffmpeg. -RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \ - emconfigure ./configure \ +WORKDIR /tmp/ffmpeg-${FFMPEG_VERSION} +RUN emconfigure ./configure \ --prefix=${PREFIX} \ --target-os=none \ --arch=x86_32 \ @@ -90,8 +91,7 @@ RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \ --objcc=emcc \ --dep-cc=emcc -RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \ - emmake make -j4 && \ +RUN emmake make -j4 && \ emmake make install @@ -100,4 +100,4 @@ COPY ./Makefile /build/Makefile WORKDIR /build -RUN make \ No newline at end of file +RUN make