Dockerfile构建nginx镜像

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

已标记关键词 清除标记
表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页