安装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