-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathDockerfile.base3
More file actions
108 lines (88 loc) · 4.48 KB
/
Dockerfile.base3
File metadata and controls
108 lines (88 loc) · 4.48 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
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
ARG ARCH
#------------------------------------------------------------------------------------
#--------------------------build-----------------------------------------------------
#------------------------------------------------------------------------------------
# http://releases.ubuntu.com/focal/
FROM ${ARCH}ossrs/srs:ubuntu20-base2 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 \
gperf python3
# Libs path for app which depends on ssl, such as libsrt.
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"]
# To limit each jobs in 6h, see https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits
RUN which cmake && cmake --version
# Cost: 502.5s
# The libsrt for SRS, which depends on openssl and cmake.
# Or use cmake if you like:
# mkdir -p build && cd build && cmake .. -DENABLE_SHARED=OFF -DENABLE_STATIC=ON -DENABLE_APPS=OFF -DENABLE_CXX11=OFF
ADD srt-1.5.3.tar.gz /tmp
RUN cd /tmp/srt-1.5.3 && \
./configure --enable-shared=0 --enable-static --disable-app --enable-c++11=0 && \
make -j${JOBS} && make install && \
rm -rf /tmp/srt-1.5.3
# Cost: 904.1s
# For libxml2, depends on cmake.
RUN apt install -y python-dev
ADD libxml2-2.9.12.tar.gz /tmp
RUN cd /tmp/libxml2-2.9.12 && ./autogen.sh && ./configure --disable-shared --enable-static && make -j${JOBS} && make install
# Cost: 371.5s
# For libx265, depends on cmake. Note that we force to generate the x265.pc by replace X265_LATEST_TAG.
# if(X265_LATEST_TAG)
# configure_file("x265.pc.in" "x265.pc" @ONLY)
ADD x265-3.5_RC2.tar.bz2 /tmp
# Disable libx265 for ARMv7, because it failed for https://github.com/google/XNNPACK/issues/1465
# blockcopy8.S:679: Error: selected processor does not support `usad8 r0,r0,r1' in ARM mode
RUN if [[ $TARGETPLATFORM != 'linux/arm/v7' ]]; then \
cd /tmp/x265-3.5_RC2/build/linux && \
sed -i 's/^if(X265_LATEST_TAG)/if(TRUE)/g' ../../source/CMakeLists.txt && \
cmake -DENABLE_SHARED=OFF ../../source && make -j${JOBS} && make install && \
rm -rf /tmp/x265-3.5_RC2; \
fi
# Cost: 204s
ADD libpng-1.6.40.tar.gz /tmp
RUN cd /tmp/libpng-1.6.40 && ./configure --disable-shared --enable-static && make -j${JOBS} && make install && \
rm -rf /tmp/libpng-1.6.40
# Cost: 128s
ADD fribidi-1.0.13.tar.bz2 /tmp
RUN cd /tmp/fribidi-1.0.13 && ./configure --disable-shared --enable-static && make -j${JOBS} && make install && \
rm -rf /tmp/fribidi-1.0.13
# Cost: 2167s
ADD harfbuzz-8.3.0.tar.bz2 /tmp
RUN cd /tmp/harfbuzz-8.3.0 && ./configure --disable-shared --enable-static && make -j${JOBS} && make install && \
rm -rf /tmp/harfbuzz-8.3.0
# Cost: 259s
# Depends on libpng.
ADD freetype-2.13.2.tar.gz /tmp
RUN cd /tmp/freetype-2.13.2 && ./configure --disable-shared --enable-static && make -j${JOBS} && make install && \
rm -rf /tmp/freetype-2.13.2
# Cost: 174s
ADD expat-2.5.0.tar.bz2 /tmp
RUN cd /tmp/expat-2.5.0 && ./configure --disable-shared --enable-static && make -j${JOBS} && make install && \
rm -rf /tmp/expat-2.5.0
# Cost: 399s
# Depends on gperf, expat, freetype.
ADD fontconfig-2.14.2.tar.bz2 /tmp
RUN cd /tmp/fontconfig-2.14.2 && ./configure --disable-shared --enable-static && make -j${JOBS} && make install && \
rm -rf /tmp/fontconfig-2.14.2
# Cost: 130.9s
# For libass, which depends on libfreetype6-dev, libfribidi-dev, libharfbuzz-dev, libfontconfig1-dev.
ADD libass-0.17.1.tar.gz /tmp
RUN cd /tmp/libass-0.17.1 && ./configure --disable-shared --enable-static && make -j${JOBS} && make install && \
rm -rf /tmp/libass-0.17.1