From 2871e19bf73a8b98ed0b201397aafa9f79e67286 Mon Sep 17 00:00:00 2001 From: andreas Date: Sun, 11 Aug 2019 11:23:59 +0200 Subject: [PATCH] improved dockerfile with tar.gz download instead of phar download and multi core build options --- Dockerfile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index dc8fad9..8bdc8ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM alpine:3.9.2 ENV WORKDIR /mnt -ARG M4B_TOOL_DOWNLOAD_LINK="https://github.com/sandreas/m4b-tool/releases/latest/download/m4b-tool.phar" ARG FFMPEG_VERSION=4.1 ARG PREFIX=/ffmpeg_build @@ -26,7 +25,6 @@ echo "---- INSTALL BUILD DEPENDENCIES ----" \ openssl-dev \ opus-dev \ git \ - tar \ wget && \ echo "---- INSTALL RUNTIME PACKAGES ----" \ && apk add --no-cache --update --upgrade bzip2 \ @@ -56,6 +54,7 @@ echo "---- INSTALL RUNTIME PACKAGES ----" \ php7-phar \ pkgconf \ pkgconfig \ + tar \ && echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories \ && apk add --update fdk-aac-dev \ && echo "date.timezone = UTC" >> /etc/php7/php.ini && \ @@ -86,28 +85,37 @@ echo "---- COMPILE FFMPEG ----" \ --extra-ldflags="-L/tmp${PREFIX}/lib" \ --extra-libs="-lpthread -lm" \ --bindir="/usr/local/bin/" \ - && make && make install && make distclean && hash -r && rm -rf /tmp/* && \ + && make -j4 && make install && make distclean && hash -r && rm -rf /tmp/* && \ echo "---- COMPILE SANDREAS MP4V2 ----" \ && cd /tmp/ \ && wget https://github.com/sandreas/mp4v2/archive/master.zip \ && unzip master.zip \ && rm master.zip \ && cd mp4v2-master \ - && ./configure && make && make install && make distclean && rm -rf /tmp/* && \ + && ./configure && make -j4 && make install && make distclean && rm -rf /tmp/* && \ echo "---- COMPILE FDKAAC ----" \ && cd /tmp/ \ && wget https://github.com/nu774/fdkaac/archive/1.0.0.tar.gz \ && tar xzf 1.0.0.tar.gz \ && rm 1.0.0.tar.gz \ && cd fdkaac-1.0.0 \ - && autoreconf -i && ./configure && make && make install && rm -rf /tmp/* && \ + && autoreconf -i && ./configure && make -j4 && make install && rm -rf /tmp/* && \ echo "---- REMOVE BUILD DEPENDENCIES ----" \ && apk del --purge build-dependencies +ARG M4B_TOOL_DOWNLOAD_LINK="https://github.com/sandreas/m4b-tool/releases/latest/download/m4b-tool.tar.gz" + # workaround to copy a local m4b-tool.phar IF it exists -ADD ./Dockerfile ./dist/m4b-tool.phar* /tmp/ +#ADD ./Dockerfile ./dist/m4b-tool.phar* /tmp/ RUN echo "---- INSTALL M4B-TOOL ----" \ - && if [ ! -f /tmp/m4b-tool.phar ]; then wget "${M4B_TOOL_DOWNLOAD_LINK}" -O /tmp/m4b-tool.phar ; fi \ + && if [ ! -f /tmp/m4b-tool.phar ]; then \ + cd /tmp/ && \ + wget "${M4B_TOOL_DOWNLOAD_LINK}" && \ + if [ ! -f /tmp/m4b-tool.phar ]; then \ + tar xzf m4b-tool*.tar.gz && rm m4b-tool*.tar.gz ;\ + fi && \ + cd - ; \ + fi \ && mv /tmp/m4b-tool.phar /usr/local/bin/m4b-tool \ && chmod +x /usr/local/bin/m4b-tool