2022-06-11 02:17:33 +00:00
|
|
|
ARG ARCH
|
|
|
|
FROM ${ARCH}ossrs/srs:ubuntu20 AS build
|
2021-08-14 12:46:52 +00:00
|
|
|
|
2022-06-11 02:17:33 +00:00
|
|
|
ARG BUILDPLATFORM
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG JOBS=2
|
2022-01-13 09:08:01 +00:00
|
|
|
ARG SRS_AUTO_PACKAGER
|
2022-06-11 02:17:33 +00:00
|
|
|
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, JOBS: $JOBS, PACKAGER: ${#SRS_AUTO_PACKAGER}"
|
|
|
|
|
|
|
|
# https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
|
|
|
# Install depends tools.
|
|
|
|
RUN apt-get update && apt-get install -y gcc make g++ patch unzip perl git
|
2022-01-13 09:08:01 +00:00
|
|
|
|
2021-08-14 12:46:52 +00:00
|
|
|
# Build and install SRS.
|
2021-08-15 11:01:55 +00:00
|
|
|
COPY . /srs
|
|
|
|
WORKDIR /srs/trunk
|
2022-06-11 02:17:33 +00:00
|
|
|
RUN ./configure --srt=on --jobs=${JOBS} && make -j${JOBS} && make install
|
2021-08-14 12:46:52 +00:00
|
|
|
|
|
|
|
# All config files for SRS.
|
2021-08-15 03:21:36 +00:00
|
|
|
RUN cp -R conf /usr/local/srs/conf && \
|
|
|
|
cp research/api-server/static-dir/index.html /usr/local/srs/objs/nginx/html/ && \
|
|
|
|
cp research/api-server/static-dir/favicon.ico /usr/local/srs/objs/nginx/html/ && \
|
|
|
|
cp research/players/crossdomain.xml /usr/local/srs/objs/nginx/html/ && \
|
|
|
|
cp -R research/console /usr/local/srs/objs/nginx/html/ && \
|
|
|
|
cp -R research/players /usr/local/srs/objs/nginx/html/ && \
|
|
|
|
cp -R 3rdparty/signaling/www/demos /usr/local/srs/objs/nginx/html/
|
2021-08-14 12:46:52 +00:00
|
|
|
|
|
|
|
############################################################
|
|
|
|
# dist
|
|
|
|
############################################################
|
2022-06-11 02:17:33 +00:00
|
|
|
FROM ${ARCH}ubuntu:focal AS dist
|
|
|
|
|
|
|
|
ARG BUILDPLATFORM
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM"
|
2021-08-14 12:46:52 +00:00
|
|
|
|
2021-08-14 13:10:42 +00:00
|
|
|
# Expose ports for streaming @see https://github.com/ossrs/srs#ports
|
|
|
|
EXPOSE 1935 1985 8080 8000/udp 10080/udp
|
2021-08-14 12:46:52 +00:00
|
|
|
|
|
|
|
# FFMPEG 4.1
|
|
|
|
COPY --from=build /usr/local/bin/ffmpeg /usr/local/srs/objs/ffmpeg/bin/ffmpeg
|
|
|
|
# SRS binary, config files and srs-console.
|
|
|
|
COPY --from=build /usr/local/srs /usr/local/srs
|
|
|
|
|
|
|
|
# Default workdir and command.
|
|
|
|
WORKDIR /usr/local/srs
|
2021-10-08 13:58:33 +00:00
|
|
|
CMD ["./objs/srs", "-c", "conf/docker.conf"]
|