-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
342 lines (331 loc) · 15 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
FROM aemdesign/oracle-jdk:jdk8
LABEL os="centos" \
container.description="centos with oracle jdk and ffmpeg" \
image.source="https://github.com/jrottenberg/ffmpeg/tree/master/docker-images" \
version="1.0.0" \
imagename="java-ffmpeg" \
maintainer="[email protected]" \
test.command=" java -version 2>&1 | grep 'java version' | sed -e 's/.*java version "\(.*\)".*/\1/'" \
test.command.verify="1.8"
ARG PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig
ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib
ARG PREFIX=/opt/ffmpeg
ARG MAKEFLAGS="-j2"
ENV FFMPEG_VERSION="4.0" \
FFMPEG_GPGKEY="D67658D8" \
FDKAAC_VERSION="0.1.5" \
FREETYPE_VERSION="2.9.1" \
FREETYPE_SHA256SUM="ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce" \
FRIBIDI_VERSION="0.19.7" \
FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8" \
FONTCONFIG_VERSION="2.12.4" \
LAME_MAJORVERSION="3.100" \
LAME_VERSION="3.100" \
LIBASS_VERSION="0.13.7" \
LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7" \
OGG_VERSION="1.3.2" \
OGG_SHA256="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692" \
OPENCOREAMR_VERSION="0.1.5" \
OPUS_VERSION="1.2" \
OPUS_SHA256="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9" \
OPENJPEG_VERSION="2.1.2" \
THEORA_VERSION="1.1.1" \
THEORA_SHA256="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b" \
VORBIS_VERSION="1.3.5" \
VORBIS_SHA256="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce" \
VPX_VERSION="1.7.0" \
X264_VERSION="20170226-2245-stable" \
X265_VERSION="2.3" \
XVID_VERSION="1.3.4" \
XVID_SHA256="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f" \
YASM_VERSION="1.3.0" \
LIBVIDSTAB_VERSION="1.1.0" \
LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb" \
KVAZAAR_VERSION="1.2.0" \
AOM_VERSION="dd36e78d825fb2034ea0e3c630cd43360f241021" \
SRC="/usr/local"
ENV OGG_SHA256SUM="${OGG_SHA256} libogg-${OGG_VERSION}.tar.gz" \
OPUS_SHA256SUM="${OPUS_SHA256} opus-${OPUS_VERSION}.tar.gz" \
THEORA_SHA256SUM="${THEORA_SHA256} libtheora-${THEORA_VERSION}.tar.gz" \
VORBIS_SHA256SUM="${VORBIS_SHA256} libvorbis-${VORBIS_VERSION}.tar.gz" \
XVID_SHA256SUM="${XVID_SHA256} xvidcore-${XVID_VERSION}.tar.gz" \
FREETYPE_SHA256SUM="${FREETYPE_SHA256SUM} freetype-${FREETYPE_VERSION}.tar.gz" \
LIBVIDSTAB_SHA256SUM="${LIBVIDSTAB_SHA256SUM} v${LIBVIDSTAB_VERSION}.tar.gz" \
LIBASS_SHA256SUM="${LIBASS_SHA256SUM} ${LIBASS_VERSION}.tar.gz" \
FRIBIDI_SHA256SUM="${FRIBIDI_SHA256SUM} fribidi-${FRIBIDI_VERSION}.tar.gz"
WORKDIR /tmp/workdir
#https://docs.google.com/uc?id=0B3Uxax626E5DOVdJNjc0TW9Mbmc&export=download
COPY msft-fonts.zip ./
RUN \
echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \
yum install -y --enablerepo=extras epel-release && \
yum install -y autoconf automake bzip2 freetype-devel gcc gcc-c++ git libtool make cmake3 nasm pkgconfig expat-devel gperf libgomp \
zlib-devel libXext-devel libXfixes-devel perl openssl-devel tar yasm which unzip wget && \
#make cmake3 be default cmake
ln -sf /usr/bin/cmake3 /usr/bin/cmake && \
ln -sf /usr/bin/cpack3 /usr/bin/cpack && \
ln -sf /usr/bin/ctest3 /usr/bin/ctest
RUN \
## opencore-amr https://sourceforge.net/projects/opencore-amr/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sL https://sourceforge.mirrorservice.org/o/op/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \
tar -zx --strip-components=1 && \
./configure --prefix="${PREFIX}" --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## x264 http://www.videolan.org/developers/x264.html
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \
tar -jx --strip-components=1 && \
./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## x265 http://x265.org/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sL https://download.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \
tar -zx && \
cd x265_${X265_VERSION}/build/linux && \
sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \
sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \
./multilib.sh && \
make -C 8bit install && \
rm -rf ${DIR} && \
#RUN \
## libogg https://www.xiph.org/ogg/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \
echo ${OGG_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \
./configure --prefix="${PREFIX}" --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## libopus https://www.opus-codec.org/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO http://downloads.xiph.org/releases/opus/opus-${OPUS_VERSION}.tar.gz && \
echo ${OPUS_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \
autoreconf -fiv && \
./configure --prefix="${PREFIX}" --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## libvorbis https://xiph.org/vorbis/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \
echo ${VORBIS_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \
./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## libtheora http://www.theora.org/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \
echo ${THEORA_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \
./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## libvpx https://www.webmproject.org/code/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \
tar -zx --strip-components=1 && \
./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-pic --enable-shared \
--disable-debug --disable-examples --disable-docs --disable-install-bins && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## libmp3lame http://lame.sourceforge.net/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sL https://sourceforge.mirrorservice.org/l/la/lame/lame/${LAME_MAJORVERSION}/lame-${LAME_VERSION}.tar.gz | \
tar -zx --strip-components=1 && \
./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## xvid https://www.xvid.com/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \
echo ${XVID_SHA256SUM} | sha256sum --check && \
tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \
cd xvidcore/build/generic && \
./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --datadir="${DIR}" && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## fdk-aac https://github.com/mstorsjo/fdk-aac
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \
tar -zx --strip-components=1 && \
autoreconf -fiv && \
./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \
make && \
make install && \
make distclean && \
rm -rf ${DIR} && \
#RUN \
## openjpeg https://github.com/uclouvain/openjpeg
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \
tar -zx --strip-components=1 && \
cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## freetype https://www.freetype.org/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
echo ${FREETYPE_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \
./configure --prefix="${PREFIX}" --disable-static --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## libvstab https://github.com/georgmartius/vid.stab
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz &&\
echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## fridibi https://www.fribidi.org/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sL -o fribidi-${FRIBIDI_VERSION}.tar.gz https://codeload.github.com/fribidi/fribidi/tar.gz/${FRIBIDI_VERSION} &&\
echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f fribidi-${FRIBIDI_VERSION}.tar.gz && \
sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib/' Makefile.am && \
./bootstrap --no-config && \
./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 &&\
tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \
./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## libass https://github.com/libass/libass
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz &&\
echo ${LIBASS_SHA256SUM} | sha256sum --check && \
tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \
./autogen.sh && \
./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## kvazaar https://github.com/ultravideo/kvazaar
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz &&\
tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \
./autogen.sh && \
./configure -prefix="${PREFIX}" --disable-static --enable-shared && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## aomedia https://aomedia.googlesource.com/aom/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO https://aomedia.googlesource.com/aom/+archive/${AOM_VERSION}.tar.gz && \
tar -zx -f ${AOM_VERSION}.tar.gz && \
rm -rf CMakeCache.txt CMakeFiles && \
mkdir -p ./aom_build && \
cd ./aom_build && \
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_DOCS=0 .. && \
make && \
make install && \
rm -rf ${DIR} && \
#RUN \
## ffmpeg https://ffmpeg.org/
DIR=$(mktemp -d) && cd ${DIR} && \
curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
./configure \
--disable-debug \
--disable-doc \
--disable-ffplay \
--enable-shared \
--enable-avresample \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-gpl \
--enable-libass \
--enable-libfreetype \
--enable-libvidstab \
--enable-libfdk_aac \
--enable-libmp3lame \
--enable-libopenjpeg \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-libxvid \
--enable-x86asm \
--enable-gpl \
--enable-libx264 \
--enable-nonfree \
--enable-openssl \
--enable-libfdk_aac \
--enable-libkvazaar \
--enable-libaom --extra-libs=-lpthread \
--enable-postproc \
--enable-small \
--enable-version3 \
--enable-zlib \
--extra-cflags="-I${PREFIX}/include" \
--extra-ldflags="-L${PREFIX}/lib" \
--extra-libs=-ldl \
--prefix="${PREFIX}" && \
make && \
make install && \
make distclean && \
hash -r && \
cd tools && \
make qt-faststart && \
cp qt-faststart ${PREFIX}/bin && \
rm -rf ${DIR} && \
#RUN \
## setup ffmpeg lib64 libs
ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \
cp ${PREFIX}/bin/* /usr/local/bin/ && \
cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \
LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \
ldconfig -v && ffmpeg -buildconf && \
#RUN \
## setup jre fallback fonts
mkdir -p /usr/java/default/jre/lib/fonts/fallback && \
ln -s /usr/share/fonts/cjkuni-ukai/ukai.ttc /usr/java/default/jre/lib/fonts/fallback && \
ln -s /usr/share/fonts/cjkuni-uming/uming.ttc /usr/java/default/jre/lib/fonts/fallback && \
cd /tmp/workdir && unzip msft-fonts.zip && cp msft-fonts/* /usr/java/default/jre/lib/fonts/fallback/ && \
rm -fr /tmp/workdir/msft-fonts /tmp/workdir/msft-fonts.zip && \
#RUN \
## clenaup
yum clean all && rm -rf /var/lib/yum/*
ENV LD_LIBRARY_PATH=/usr/local/lib64
#CMD ["/bin/bash"]