Repository navigation
Expand file tree
/
Copy pathDockerfile.base52
More file actions
63 lines (51 loc) · 2.55 KB
/
Copy pathDockerfile.base52
File metadata and controls
63 lines (51 loc) · 2.55 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
ARG ARCH
#------------------------------------------------------------------------------------
#--------------------------build-----------------------------------------------------
#------------------------------------------------------------------------------------
# http://releases.ubuntu.com/focal/
FROM ${ARCH}ossrs/srs:ubuntu20-base3 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.
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"]
# The cmake should be ready in base image.
RUN which cmake && cmake --version
# Cost:
# Build FFmpeg, static link libraries.
ADD ffmpeg-7.1.1.tar.bz2 /tmp
RUN FFOPTIONS=""; if [[ $TARGETPLATFORM != 'linux/arm/v7' ]]; then \
FFOPTIONS="$FFOPTIONS --enable-libx265"; \
fi; \
cd /tmp/ffmpeg-7.1.1 && ./configure --enable-pthreads --extra-libs=-lpthread \
--pkg-config-flags='--static' \
--enable-gpl --enable-nonfree \
--enable-postproc --enable-bzlib --enable-zlib \
--enable-libx264 --enable-libmp3lame --enable-libfdk-aac \
--enable-libxml2 --enable-demuxer=dash \
--enable-openssl --enable-protocol=tls --enable-protocol=rtmps \
--enable-filter=drawtext --enable-libfreetype --enable-libfontconfig \
--enable-libass \
--enable-libsrt ${FFOPTIONS} && \
make -j${JOBS} && make install && \
rm -rf /tmp/ffmpeg-7.1.1 && \
echo "FFmpeg7 build and install successfully"
RUN cp /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg7 && \
cp /usr/local/bin/ffprobe /usr/local/bin/ffprobe7
RUN ls -lh /usr/local/bin/*