use ubuntu:18.04 baseimage

This commit is contained in:
an 2018-07-25 08:08:54 +02:00
parent b10325c932
commit b8c0101478
2 changed files with 29 additions and 51 deletions

View File

@ -1,5 +1,5 @@
FROM alpine:3.4
LABEL author Alfred Gutierrez <alf.g.jr@gmail.com>
FROM ubuntu:18.04
LABEL author Andreas Neue <an@dnix.deÂ
ENV NGINX_VERSION 1.13.9
ENV NGINX_RTMP_VERSION 1.2.1
@ -11,57 +11,20 @@ EXPOSE 80
RUN mkdir -p /opt/data && mkdir /www
# Build dependencies.
RUN apk update && apk add \
binutils \
binutils-libs \
build-base \
ca-certificates \
gcc \
libc-dev \
libgcc \
make \
musl-dev \
openssl \
openssl-dev \
pcre \
pcre-dev \
pkgconf \
pkgconfig \
zlib-dev
# Get nginx source.
RUN cd /tmp && \
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar zxf nginx-${NGINX_VERSION}.tar.gz && \
rm nginx-${NGINX_VERSION}.tar.gz
# update and upgrade packages
RUN apt-get update && apt-get upgrade -y && apt-get clean
RUN apt-get install -y build-essential wget htop vim nasm
RUN apt-get install -y software-properties-common
#RUN apt-get install -y ffmpeg
RUN apt-get install -y libpcre3-dev zlib1g-dev libssl-dev libass-dev \
libfdk-aac-dev libmp3lame-dev libopus-dev librtmp-dev libtheora-dev \
libvorbis-dev libvpx-dev libx264-dev libx265-dev libwebp-dev
# Get nginx-rtmp module.
RUN cd /tmp && \
wget https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}.tar.gz && \
tar zxf v${NGINX_RTMP_VERSION}.tar.gz && rm v${NGINX_RTMP_VERSION}.tar.gz
# Compile nginx with nginx-rtmp module.
RUN cd /tmp/nginx-${NGINX_VERSION} && \
./configure \
--prefix=/opt/nginx \
--add-module=/tmp/nginx-rtmp-module-${NGINX_RTMP_VERSION} \
--conf-path=/opt/nginx/nginx.conf \
--error-log-path=/opt/nginx/logs/error.log \
--http-log-path=/opt/nginx/logs/access.log \
--with-debug && \
cd /tmp/nginx-${NGINX_VERSION} && make && make install
# FFmpeg dependencies.
RUN apk add --update nasm yasm-dev lame-dev libogg-dev x264-dev libvpx-dev libvorbis-dev x265-dev freetype-dev libass-dev libwebp-dev rtmpdump-dev libtheora-dev opus-dev
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
RUN apk add --update fdk-aac-dev
# Get FFmpeg source.
RUN cd /tmp/ && \
wget http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
tar zxf ffmpeg-${FFMPEG_VERSION}.tar.gz && rm ffmpeg-${FFMPEG_VERSION}.tar.gz
# Compile ffmpeg.
RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \
./configure \
--enable-version3 \
@ -86,10 +49,25 @@ RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \
--disable-debug && \
make && make install && make distclean
# Cleanup.
RUN rm -rf /var/cache/* /tmp/*
RUN cd /tmp && \
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar zxf nginx-${NGINX_VERSION}.tar.gz && \
rm nginx-${NGINX_VERSION}.tar.gz
RUN cd /tmp && \
wget https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}.tar.gz && \
tar zxf v${NGINX_RTMP_VERSION}.tar.gz && rm v${NGINX_RTMP_VERSION}.tar.gz
RUN cd /tmp/nginx-${NGINX_VERSION} && \
./configure \
--prefix=/opt/nginx \
--add-module=/tmp/nginx-rtmp-module-${NGINX_RTMP_VERSION} \
--conf-path=/opt/nginx/nginx.conf \
--error-log-path=/opt/nginx/logs/error.log \
--http-log-path=/opt/nginx/logs/access.log \
--with-debug && \
cd /tmp/nginx-${NGINX_VERSION} && make && make install
# Add NGINX config and static files.
ADD nginx.conf /opt/nginx/nginx.conf
ADD static /www/static

View File

@ -14,7 +14,7 @@ rtmp {
application stream {
live on;
exec ffmpeg -i rtmp://localhost:1935/stream/$name
exec /usr/local/bin/ffmpeg -i rtmp://localhost:1935/stream/$name
-c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 2500k -f flv -g 30 -r 30 -s 1280x720 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_720p2628kbs
-c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 1000k -f flv -g 30 -r 30 -s 854x480 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_480p1128kbs
-c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 750k -f flv -g 30 -r 30 -s 640x360 -preset superfast -profile:v baseline rtmp://localhost:1935/hls/$name_360p878kbs