Dockerfile构建nginx镜像
Posted effortsing
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Dockerfile构建nginx镜像相关的知识,希望对你有一定的参考价值。
Dockerfile构建nginx镜像 [[email protected] ~]# mkdir /opt/docker-file [[email protected] ~]# cd /opt/docker-file/ [[email protected] docker-file]# mkdir nginx [[email protected] docker-file]# cd nginx/ [[email protected] nginx]# wget http://nginx.org/download/nginx-1.9.9.tar.gz [[email protected] nginx]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.42.tar.gz [[email protected] nginx]# vi Dockerfile #必须大写 #this is my dockerfile #verion 1.0 #auther zi hao #Base imags FROM centos :默认从本地 #MAINTAINER MAINTAINER zi hao #ADD ADD pcre-8.42.tar.gz /usr/local/src ADD nginx-1.9.9.tar.gz /usr/local/src #RUN RUN yum install -y wget gcc gcc-c++ make openssl-devel RUN useradd -s /sbin/nologin -M www #WORKDIR WORKDIR /usr/local/src/nginx-1.9.9 RUN ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-pcre=/usr/local/src/pcre-8.42 && make && make install RUN echo "daemon off;" >> /usr/local/nginx/nginx.conf ENV PATH /usr/local/ngix/sbin:$PATH EXPOSE 80 CMD ["nginx"]
以上是关于Dockerfile构建nginx镜像的主要内容,如果未能解决你的问题,请参考以下文章
dockfile概述,使用dockerfile构建Nginx,Tomcat镜像