parent
e0ce764a12
commit
01e6f48ae6
2 changed files with 31 additions and 32 deletions
@ -1,48 +1,45 @@ |
|||||||
FROM centos:7 |
FROM centos:7 |
||||||
|
|
||||||
MAINTAINER iotcat (i@iotcat.me) |
MAINTAINER iotcat (i@iotcat.me) |
||||||
|
|
||||||
RUN yum -y install gcc gcc-c++ make \ |
RUN yum -y install gcc gcc-c++ make \ |
||||||
openssl-devel pcre-devel gd-devel \ |
openssl-devel pcre-devel gd-devel \ |
||||||
libxml2-devel libxslt-devel zlib-devel \ |
libxml2-devel libxslt-devel zlib-devel \ |
||||||
gd-devel perl-ExtUtils-Embed \ |
gd-devel perl-ExtUtils-Embed \ |
||||||
iproute net-tools telnet wget curl && \ |
iproute net-tools telnet wget curl && \ |
||||||
yum clean all && \ |
yum clean all && \ |
||||||
useradd -s /sbin/nologin -M nginx && \ |
useradd -s /sbin/nologin -M nginx && \ |
||||||
mkdir -p /var/tmp/nginx && \ |
mkdir -p /var/tmp/nginx && \ |
||||||
rm -rf /var/cache/yum/ |
rm -rf /var/cache/yum/ |
||||||
|
|
||||||
RUN wget http://nginx.org/download/nginx-1.16.1.tar.gz &&\ |
RUN wget http://nginx.org/download/nginx-1.15.9.tar.gz &&\ |
||||||
tar -zxvf nginx-1.16.1.tar.gz && \ |
tar -zxvf nginx-1.15.9.tar.gz && \ |
||||||
cd nginx-1.16.1 && \ |
cd nginx-1.15.9 && \ |
||||||
sed -i "s#\"NGINX\"#\"Ushio\"#" src/core/nginx.h && \ |
sed -i "s#\"NGINX\"#\"Ushio\"#" src/core/nginx.h && \ |
||||||
sed -i "s#\"nginx/\"#\"Ushio/\"#" src/core/nginx.h && \ |
sed -i "s#\"nginx/\"#\"Ushio/\"#" src/core/nginx.h && \ |
||||||
sed -i "s#Server: nginx#Server: Ushio#" src/http/ngx_http_header_filter_module.c && \ |
sed -i "s#Server: nginx#Server: Ushio#" src/http/ngx_http_header_filter_module.c && \ |
||||||
sed -i "s#\"<hr><center>nginx<\/center>\"#\"<hr><center>Ushio<\/center>\"#" src/http/ngx_http_special_response.c && \ |
sed -i "s#\"<hr><center>nginx<\/center>\"#\"<hr><center>Ushio<\/center>\"#" src/http/ngx_http_special_response.c && \ |
||||||
./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx \ |
./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx \ |
||||||
--conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/error.log \ |
--conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/error.log \ |
||||||
--http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid \ |
--http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid \ |
||||||
--user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module \ |
--user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module \ |
||||||
--with-threads --with-file-aio --with-http_v2_module \ |
--with-threads --with-file-aio --with-http_v2_module \ |
||||||
--with-http_realip_module --with-http_addition_module \ |
--with-http_realip_module --with-http_addition_module \ |
||||||
--with-http_xslt_module --with-http_image_filter_module \ |
--with-http_xslt_module --with-http_image_filter_module \ |
||||||
--with-http_sub_module --with-http_flv_module \ |
--with-http_sub_module --with-http_flv_module \ |
||||||
--with-http_mp4_module --with-http_gunzip_module \ |
--with-http_mp4_module --with-http_gunzip_module \ |
||||||
--with-http_gzip_static_module --with-http_auth_request_module \ |
--with-http_gzip_static_module --with-http_auth_request_module \ |
||||||
--with-http_secure_link_module --with-http_slice_module \ |
--with-http_secure_link_module --with-http_slice_module \ |
||||||
--with-http_perl_module --with-compat \ |
--with-http_perl_module --with-compat \ |
||||||
--with-stream --with-stream_ssl_module --with-stream_realip_module \ |
--with-stream --with-stream_ssl_module --with-stream_realip_module \ |
||||||
--with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client \ |
--with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client \ |
||||||
--http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fcgi \ |
--http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fcgi \ |
||||||
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre && \ |
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre && \ |
||||||
make -j 4 && make install && \ |
make -j 4 && make install && \ |
||||||
cd / && rm -rf nginx-1.16.1 #&& \ |
cd / && rm -rf nginx-1.15.9 && \ |
||||||
#yum remove -y wget |
rm -rf nginx-1.15.9.tar.gz |
||||||
#ls -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
|
||||||
|
|
||||||
ENV PATH $PATH:/usr/local/nginx/sbin |
ENV PATH $PATH:/usr/local/nginx/sbin |
||||||
WORKDIR /usr/local/nginx |
WORKDIR /usr/local/nginx |
||||||
|
EXPOSE 80 443 21515 30034 |
||||||
EXPOSE 80 |
|
||||||
EXPOSE 443 |
|
||||||
CMD ["nginx", "-g","daemon off;"] |
CMD ["nginx", "-g","daemon off;"] |
||||||
|
@ -1,9 +1,11 @@ |
|||||||
#!/bin/bash |
#!/bin/bash |
||||||
docker run -d \ |
docker run -d \ |
||||||
--name=nginx \ |
--name=nginx \ |
||||||
-p 9980:80 \ |
-p 80:80 \ |
||||||
-p 9443:443 \ |
-p 443:443 \ |
||||||
|
-p 21515:21515 \ |
||||||
|
-p 30034:30034 \ |
||||||
-v /etc/nginx/nginx.conf:/usr/local/nginx/conf/nginx.conf \ |
-v /etc/nginx/nginx.conf:/usr/local/nginx/conf/nginx.conf \ |
||||||
-v /etc/nginx/vhost/:/usr/local/nginx/conf/vhost/ \ |
-v /etc/nginx/vhost/:/usr/local/nginx/conf/vhost/ \ |
||||||
-v /var/log/nginx/:/var/log/nginx/ \ |
-v /var/log/nginx/:/var/log/nginx/ \ |
||||||
ushio-nginx |
iotcat/ushio-nginx |
||||||
|
Loading…
Reference in new issue