-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
140 lines (131 loc) · 4.27 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
FROM phusion/baseimage:master
#Basic Container
RUN echo "---- INSTALL RUNTIME PACKAGES ----" && \
apt-get update && apt-get install -y --no-install-recommends \
python3-pip \
git \
#ffmpeg \
dnsutils \
iputils-ping \
wget \
crudini && rm -rf /var/lib/apt/lists/*
#Build layer
RUN echo "---- INSTALL ALL BUILD-DEPENDENCIES ----" && \
buildDeps='gcc \
g++ \
make \
autoconf \
automake \
build-essential \
cmake \
git-core \
libass-dev \
libfreetype6-dev \
libgnutls28-dev \
libmp3lame-dev \
libsdl2-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
meson \
ninja-build \
pkg-config \
texinfo \
yasm \
libfdk-aac-dev \
zlib1g-dev' && \
set -x && \
apt-get update && apt-get install -y $buildDeps --no-install-recommends && \
rm -rf /var/lib/apt/lists/* && \
echo "---- BUILD & INSTALL MP4V2 ----" && \
mkdir -p /tmp && \
cd /tmp && \
git clone https://github.com/sandreas/mp4v2 && \
cd mp4v2 && \
./configure && \
make && \
make install && \
make distclean && \
echo "---- BUILD & INSTALL ffmpeg ----" && \
mkdir -p ~/ffmpeg_sources ~/bin && \
cd ~/ffmpeg_sources && \
git -C fdk-aac pull 2> /dev/null || git clone --depth 1 https://github.com/mstorsjo/fdk-aac && \
cd fdk-aac && \
autoreconf -fiv && \
./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \
make && \
make install && \
make distclean && \
cd ~/ffmpeg_sources && \
wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
tar xjvf ffmpeg-snapshot.tar.bz2 && \
cd ffmpeg && \
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="$HOME/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--extra-libs="-lpthread -lm" \
--ld="g++" \
--bindir="$HOME/bin" \
--enable-libfdk-aac \
--enable-nonfree && \
PATH="$HOME/bin:$PATH" make && \
make install && \
hash -r && \
make distclean && \
mv ~/bin/* /bin/ && \
echo "---- REMOVE ALL BUILD-DEPENDENCIES ----" && \
apt-get purge -y --auto-remove $buildDeps && \
ldconfig && \
rm -r /tmp/* ~/ffmpeg_sources ~/bin
#ENV WORKDIR /mnt/
#ENV M4BTOOL_TMP_DIR /tmp/m4b-tool/
LABEL Description="Container to run m4b-tool as a deamon."
RUN echo "---- INSTALL M4B-TOOL DEPENDENCIES ----" && \
apt-get update && apt-get install -y --no-install-recommends \
fdkaac \
php-cli \
php-intl \
php-json \
php-mbstring \
php-xml \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libasound-dev \
libsdl2-dev \
libva-dev \
libvdpau-dev
#Mount volumes
VOLUME /temp
VOLUME /original
VOLUME /config
VOLUME /backup
ARG improve echo
#Merge-Script importieren
ADD runscript.sh /etc/service/bot/run
ADD auto-m4b-tool.sh /
#install actual m4b-tool
#RUN echo "---- INSTALL M4B-TOOL ----" && \
# wget https://github.com/sandreas/m4b-tool/releases/download/v.0.4.2/m4b-tool.phar -O /usr/local/bin/m4b-tool && \
# chmod +x /usr/local/bin/m4b-tool
ARG M4B_TOOL_DOWNLOAD_LINK="https://github.com/sandreas/m4b-tool/releases/latest/download/m4b-tool.tar.gz"
RUN echo "---- INSTALL M4B-TOOL ----" \
&& if [ ! -f /tmp/m4b-tool.phar ]; then \
wget "${M4B_TOOL_DOWNLOAD_LINK}" -O /tmp/m4b-tool.tar.gz && \
if [ ! -f /tmp/m4b-tool.phar ]; then \
tar xzf /tmp/m4b-tool.tar.gz -C /tmp/ && rm /tmp/m4b-tool.tar.gz ;\
fi \
fi \
&& mv /tmp/m4b-tool.phar /usr/local/bin/m4b-tool \
&& M4B_TOOL_PRE_RELEASE_LINK=$(wget -q -O - https://github.com/sandreas/m4b-tool/releases/tag/latest | grep -o 'M4B_TOOL_DOWNLOAD_LINK=[^ ]*' | head -1 | cut -d '=' -f 2) \
&& wget "${M4B_TOOL_PRE_RELEASE_LINK}" -O /tmp/m4b-tool.tar.gz \
&& tar xzf /tmp/m4b-tool.tar.gz -C /tmp/ && rm /tmp/m4b-tool.tar.gz \
&& mv /tmp/m4b-tool.phar /usr/local/bin/m4b-tool-pre \
&& chmod +x /usr/local/bin/m4b-tool /usr/local/bin/m4b-tool-pre
#use the remommended clean command
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*