-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathDockerfile
More file actions
86 lines (68 loc) · 3.41 KB
/
Dockerfile
File metadata and controls
86 lines (68 loc) · 3.41 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
ARG ARCH
#------------------------------------------------------------------------------------
#--------------------------build-----------------------------------------------------
#------------------------------------------------------------------------------------
# http://releases.ubuntu.com/focal/
FROM ${ARCH}ossrs/srs:ubuntu20-base999999 as build
# Remove fontconfig tools.
RUN rm -f /usr/local/bin/fc-*
#------------------------------------------------------------------------------------
#--------------------------dist------------------------------------------------------
#------------------------------------------------------------------------------------
# http://releases.ubuntu.com/focal/
FROM ${ARCH}ubuntu:focal as dist
ARG BUILDPLATFORM
ARG TARGETPLATFORM
ARG TARGETARCH
ARG JOBS=2
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, TARGETARCH: $TARGETARCH JOBS: $JOBS"
WORKDIR /tmp/srs
# Copy all FFmpeg versions and cmake and other tools in /usr/local.
COPY --from=build /usr/local /usr/local
# Note that the PATH has /usr/local/bin by default in ubuntu:focal.
#ENV PATH=$PATH:/usr/local/bin
# https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image
ENV DEBIAN_FRONTEND=noninteractive
# Note that git is very important for codecov to discover the .codecov.yml
RUN apt update && \
apt install -y aptitude gdb gcc g++ make patch unzip python \
autoconf automake libtool pkg-config liblzma-dev curl net-tools \
tcl
# 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. Use hash to clear cache for cmake,
# see https://stackoverflow.com/a/46805870/17679565
RUN hash -r && which cmake && cmake --version
# For https://github.com/google/sanitizers
RUN apt install -y libasan5
# Install cherrypy for HTTP hooks.
#ADD CherryPy-3.2.4.tar.gz2 /tmp
#RUN cd /tmp/CherryPy-3.2.4 && python setup.py install
# Install go, see https://go.dev/dl/
ENV PATH=$PATH:/usr/local/go/bin
RUN if [[ $TARGETARCH == 'amd64' ]]; then \
curl -L https://go.dev/dl/go1.21.13.linux-amd64.tar.gz |tar -xz -C /usr/local; \
fi
RUN if [[ $TARGETARCH == 'arm64' ]]; then \
curl -L https://go.dev/dl/go1.21.13.linux-arm64.tar.gz |tar -xz -C /usr/local; \
fi
# For linux/arm/v7, because ARMv6 is upwardly compatible with ARMv7.
RUN if [[ $TARGETARCH == 'arm' ]]; then \
curl -L https://go.dev/dl/go1.21.13.linux-armv6l.tar.gz |tar -xz -C /usr/local; \
fi
# For utest, the gtest. See https://github.com/google/googletest/releases/tag/release-1.11.0
ADD googletest-release-1.11.0.tar.gz /usr/local
RUN ln -sf /usr/local/googletest-release-1.11.0/googletest /usr/local/gtest
# Install 32bits adapter for crossbuild.
RUN if [[ $TARGETARCH != 'arm' && $TARGETARCH != 'arm64' ]]; then \
apt-get -y install lib32z1-dev; \
fi
# For cross-build: https://github.com/ossrs/srs/wiki/v4_EN_SrsLinuxArm#ubuntu-cross-build-srs
RUN if [[ $TARGETARCH != 'arm' && $TARGETARCH != 'arm64' ]]; then \
apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu; \
fi
# Update the mirror from aliyun, @see https://segmentfault.com/a/1190000022619136
#ADD sources.list /etc/apt/sources.list
#RUN apt-get update