码迷,mamicode.com
首页 > 其他好文 > 详细

docker-nginx

时间:2018-03-26 10:55:58      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:comm   har   重启   package   jsp   镜像   bsp   org   share   

安装nginx先解决依赖

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 

进入容器开始安装

docker images
docker run -it docker.io/centos /bin/bash

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 

yum -y install nginx

 nginx 转发后端tomcat

location / {
        root   /usr/share/nginx/html;
        index  index.jsp index.html index.htm;
        proxy_pass http://192.168.1.195:888;
    }

重启nginx

nginx -s reload

生成镜像

docker commit 7fc53269cda3 docker.io/nginx

 

docker-nginx

标签:comm   har   重启   package   jsp   镜像   bsp   org   share   

原文地址:https://www.cnblogs.com/zhink/p/8625070.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!