Nginx 之 centos8 下的 dockerfile

分类:Linux |

#

# MAINTAINER        Zhangxiaoyu <weifeng.zhang@jiangong.sh>

#

FROM centos:8

LABEL maintainer="ZhangXiaoYu<weifeng.zhang@jiangong.sh>"


RUN yum install -y  make gcc openssl-devel pcre-devel zlib-devel

ADD nginx-1.18.0 /opt/nginx/source

ADD nginx-http-concat-master /opt/nginx/nginx-http-concat-master


RUN useradd www -s /sbin/nologin -M && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


WORKDIR /opt/nginx/source

RUN ./configure --prefix=/opt/nginx --user=www --group=www \

--conf-path=/etc/nginx/nginx.conf  \

--with-http_gzip_static_module \

--with-http_ssl_module \

--with-http_stub_status_module \

--with-file-aio --with-http_realip_module  \

--add-module=/opt/nginx/nginx-http-concat-master


RUN make && make install


EXPOSE 80

CMD ["/opt/nginx/sbin/nginx", "-g", "daemonoff;"]


# ./configure --prefix=/opt/nginx --user=www --group=www --conf-path=/etc/nginx/nginx.conf  --with-http_gzip_static_module --with-http_ssl_module --with-http_stub_status_module --with-file-aio --with-http_realip_module  --add-module=/opt/nginx/nginx-http-concat-master