用于创建nginx镜像的dockerfile
FROM centos
MAINTAINER Simon.Wu
RUN yum install -y gcc-c++ wget pcre pcre-devel zlib zlib-devel openssl openssl-devel && \
yum clean all && \
rm -rf /var/cache/yum/*
RUN wget http://nginx.org/download/nginx-1.17.0.tar.gz && \
tar -zxvf nginx-1.17.0.tar.gz && \
cd nginx-1.17.0 && ./configure --prefix=/usr/local/nginx && \
make -j 4 && make install && \
echo "ok" >> /usr/local/nginx/html/statu.html && \
cd / && rm -rf nginx-1.17*
ENV PATH $PATH:/usr/local/nginx/sbin
WORKDIR /usr/local/nginx
EXPOSE 80
CMD ["nginx","-g","daemon off;"]