gyts62 发表于 2018-10-4 15:17:00

使用Dockerfile构建Nginx,Tomcat,MySQL镜像

vim Dockerfile  FROM centos
  MAINTAINER this is nginx image
  RUN yum install -y wget proc-devel net-tools gcc zlib zlib-devel make openssl-devel
  RUN wget http://nginx.org/download/nginx-1.9.7.tar.gz
  RUN tar zxvf nginx-1.9.7.tar.gz
  WORKDIR nginx-1.9.7
  RUN ./configure --prefix=/usr/local/nginx && make && make install
  EXPOSE 80         //http
  EXPOSE 443            //https
  RUN echo "daemon off;">>/usr/local/nginx/conf/nginx.conf   //关闭守护进程
  WORKDIR /opt/nginx
  ADD run.sh /run.sh       //将宿主机中的run.sh添加到容器中
  RUN chmod 755 /run.sh
  CMD ["/run.sh"]

页: [1]
查看完整版本: 使用Dockerfile构建Nginx,Tomcat,MySQL镜像