-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathDockerfile.base
More file actions
71 lines (58 loc) · 2.83 KB
/
Copy pathDockerfile.base
File metadata and controls
71 lines (58 loc) · 2.83 KB
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
ARG ARCH
#------------------------------------------------------------------------------------
#--------------------------build-----------------------------------------------------
#------------------------------------------------------------------------------------
# http://releases.ubuntu.com/focal/
FROM ${ARCH}ubuntu:focal AS build
ARG BUILDPLATFORM
ARG TARGETPLATFORM
ARG JOBS=2
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, JOBS: $JOBS"
# https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image
ENV DEBIAN_FRONTEND=noninteractive
# Update the mirror from aliyun, @see https://segmentfault.com/a/1190000022619136
#ADD sources.list /etc/apt/sources.list
#RUN apt-get update
RUN apt-get update && \
apt-get install -y aptitude gcc g++ make patch unzip python \
autoconf automake libtool pkg-config zlib1g-dev \
liblzma-dev libzip-dev libbz2-dev tcl
# Libs path for app which depends on ssl, such as libsrt or cmake.
ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/ssl/lib/pkgconfig
# Libs path for FFmpeg(depends on serval libs), or it fail with:
# ERROR: speex not found using pkg-config
ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
# To use if in RUN, see https://github.com/moby/moby/issues/7281#issuecomment-389440503
# Note that only exists issue like "/bin/sh: 1: [[: not found" for Ubuntu20, no such problem in CentOS7.
SHELL ["/bin/bash", "-c"]
# Cost: 3602.5s
# Openssl 1.1.* for SRS.
ADD openssl-1.1.1j.tar.bz2 /tmp
RUN cd /tmp/openssl-1.1.1j && \
./config -no-shared -no-threads --prefix=/usr/local/ssl && make -j${JOBS} && make install_sw && \
rm -rf /tmp/openssl-1.1.1j
# Openssl 1.0.* for SRS.
#ADD openssl-OpenSSL_1_0_2u.tar.gz /tmp
#RUN cd /tmp/openssl-OpenSSL_1_0_2u && \
# ./config -no-shared -no-threads --prefix=/usr/local/ssl && make -j${JOBS} && make install_sw
# Cost: 698.9s
# For FFmpeg. FFmpeg 8.1 requires NASM 2.15 or newer for x86 assembly.
ADD nasm-2.16.03.tar.bz2 /tmp
RUN cd /tmp/nasm-2.16.03 && ./configure && make -j${JOBS} && make install && \
nasm -v && \
rm -rf /tmp/nasm-2.16.03
# Cost: 1293.6s
# For aac
ADD fdk-aac-2.0.2.tar.gz /tmp
RUN cd /tmp/fdk-aac-2.0.2 && bash autogen.sh && CXXFLAGS=-Wno-narrowing ./configure --disable-shared && make -j${JOBS} && make install && \
rm -rf /tmp/fdk-aac-2.0.2
# Cost: 226.4s
# For mp3, see https://sourceforge.net/projects/lame/
ADD lame-3.100.tar.gz /tmp
RUN cd /tmp/lame-3.100 && ./configure --disable-shared && make -j${JOBS} && make install && \
rm -rf /tmp/lame-3.100
# Cost: 620.7s
# For libx264
ADD x264-snapshot-20181116-2245.tar.bz2 /tmp
RUN cd /tmp/x264-snapshot-20181116-2245 && ./configure --disable-shared --disable-cli --enable-static --enable-pic && make -j${JOBS} && make install && \
rm -rf /tmp/x264-snapshot-20181116-2245