Skip to content

Commit

Permalink
improved dockerfile with tar.gz download instead of phar download and…
Browse files Browse the repository at this point in the history
… multi core build options
  • Loading branch information
andreas committed Aug 11, 2019
1 parent 0a3dc7a commit 2871e19
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 \
Expand Down Expand Up @@ -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 && \
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 2871e19

Please sign in to comment.