#本地已有镜像FROM docker.io/centos#作者信息MAINTAINER liangyj liangyj@566560.com#安装包文件RUN yum install -y gcc pcre pcre-devel zlib zlib-devel bzip2 bzip2-devel make#下载并解压nginxWORKDIR /usr/local/srcRUN wget http://nginx.org/download/nginx-1.8.0.tar.gzRUN tar xzvf nginx-1.8.0.tar.gzWORKDIR /usr/local/src/nginx-1.8.0#编译安装nginxRUN ./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcreRUN ["make"]RUN ["make","install"]EXPOSE 80#删除nginx源码包及解压后文件RUN rm -rf /usr/local/src/nginx-1.8.0.tar.gzRUN rm -rf /usr/local/src/nginx-1.8.0#CMD["/usr/local/nginx/sbin/nginx","-c","/usr/local/nginx/conf/nginx.conf"]