#本地已有镜像 FROM docker.io/centos #作者信息 MAINTAINER liangyj liangyj@566560.com #安装包文件 RUN yum install -y gcc pcre pcre-devel zlib zlib-devel bzip2 bzip2-devel make #下载并解压nginx WORKDIR /usr/local/src RUN wget http://nginx.org/download/nginx-1.8.0.tar.gz RUN tar xzvf nginx-1.8.0.tar.gz WORKDIR /usr/local/src/nginx-1.8.0 #编译安装nginx RUN ./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcre RUN ["make"] RUN ["make","install"] EXPOSE 80 #删除nginx源码包及解压后文件 RUN rm -rf /usr/local/src/nginx-1.8.0.tar.gz RUN rm -rf /usr/local/src/nginx-1.8.0 #CMD["/usr/local/nginx/sbin/nginx","-c","/usr/local/nginx/conf/nginx.conf"]
本文出自 “ubuntu” 博客,请务必保留此出处http://thankinglove.blog.51cto.com/2311485/1794974
原文地址:http://thankinglove.blog.51cto.com/2311485/1794974