Docker构建nginx的nginx-rtmp-module视频服务器镜像

文章地址:https://www.cnblogs.com/linyilong3/p/5862595.html

GitHub nginx-rtmp-module 及配置

Dockerfile构建配置:

FROM ubuntu
RUN apt-get update
RUN apt-get install vim -y
RUN apt-get install gcc -y
RUN apt-get install git -y
RUN apt-get install mercurial -y
RUN hg clone http://hg.nginx.org/nginx
RUN git clone https://github.com/arut/nginx-rtmp-module.git
RUN cd nginx
RUN apt-get install libpcre3 libpcre3-dev
RUN apt-get install libssl-dev
RUN apt-get make
RUN ./config --add-module="./nginx-rtmp-module"
RUN make
RUN make install
EXPOSE 80

更改后的脚本:

FROM ubuntu:16.04
RUN apt-get update -y
RUN apt-get install git -y
RUN apt-get install mercurial -y
RUN apt-get install wget -y
# ------------------
# 第一种获取Nginx方式
RUN wget http://nginx.org/download/nginx-1.12.2.tar.gz
RUN tar -zxvf nginx-1.12.2.tar.gz
# 第二种获取Nginx方式
#RUN hg clone http://hg.nginx.org/nginx
# ------------------
RUN git clone https://github.com/arut/nginx-rtmp-module.git
RUN apt-get install libpcre3 libpcre3-dev -y
RUN apt-get install libssl-dev -y
RUN apt-get install make -y
RUN cd nginx-1.12.2
RUN /nginx-1.12.2/configure --add-module=/nginx-rtmp-module
RUN make
RUN make install
EXPOSE 80

 错误:

构建不是很稳定经常出错,回头再看。

原文地址:https://www.cnblogs.com/boonya/p/7911321.html