dockerfile 종합 실험

697 단어
#  Dockerfile
FROM lihanbing/nginx:v1.12.2
USER root
ENV WWW /usr/share/nginx/html
ENV CONF /etc/nginx/conf.d
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\ 
    echo 'Asia/Shanghai' >/etc/timezone
WORKDIR $WWW
ADD index.html $WWW/index.html
ADD demo.od.com.conf $CONF/demo.od.com.conf
EXPOSE 80
CMD ["nginx","-g","daemon off;"]

#[root@web02 dockerfile]# vi demo.od.com.conf
server {
   listen 80;
   server_name demo.od.com;

   root /usr/share/nginx/html;
}

#    
[root@web02 dockerfile]# docker build . -t lihanbing/nginx:baidu

#    
[root@web02 dockerfile]# docker run --rm -p80:80 lihanbing/nginx:baidu

좋은 웹페이지 즐겨찾기