Dockerfile nginx 미 러 구축

2874 단어
Dockerfile  nginx  

[root@bogon ~]# mkdir /opt/docker-file
[root@bogon ~]# cd /opt/docker-file/
[root@bogon docker-file]# mkdir nginx
[root@bogon docker-file]# cd nginx/
[root@bogon nginx]# wget http://nginx.org/download/nginx-1.9.9.tar.gz
[root@bogon nginx]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.42.tar.gz
[root@bogon 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"]

 
다음으로 전송:https://www.cnblogs.com/effortsing/p/10480721.html

좋은 웹페이지 즐겨찾기