增加1.9.9构建

This commit is contained in:
yangyu 2018-08-01 22:28:28 +08:00
parent 337051efb0
commit 68649b13b8
2 changed files with 35 additions and 0 deletions

27
nginx/1.9.9/Dockerfile Normal file
View File

@ -0,0 +1,27 @@
FROM centos:7
MAINTAINER Yang <yangyufans@qq.com>
ENV NGINX_VERSION=1.9.9
RUN yum install -y wget make gcc pcre-devel gzip zlib zlib-devel
RUN cd / && wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz \
&& tar -zxvf nginx-$NGINX_VERSION.tar.gz \
&& rm -rf nginx-$NGINX_VERSION.tar.gz \
&& cd nginx-$NGINX_VERSION \
&& ./configure --prefix=/usr/local/nginx \
&& make \
&& make install \
&& cd .. \
&& rm -rf nginx-$NGINX_VERSION
RUN mkdir -p /nginx/conf && mkdir /nginx/logs/ && mkdir /nginx/www
EXPOSE 80
COPY start.sh /
RUN chmod 777 /start.sh
CMD ["/start.sh"]

8
nginx/1.9.9/start.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
if [ ! -e /nginx/conf/nginx.conf ]; then
cp /usr/local/nginx/conf/nginx.conf /nginx/conf
sed -i "s/mime.types/\/usr\/local\/nginx\/conf\/mime.types/" /nginx/conf/nginx.conf
fi
/usr/local/nginx/sbin/nginx -c /nginx/conf/nginx.conf -g 'daemon off;'