docker安装nginx
1、查找Docker Hub上的nginx镜像[root@localhost /]# docker search nginx

3、查看镜像[root@localhost /]# docker images nginx

5、创建nginx目录[root@localhost /]# mkdir -p /usr/local/nginx/www /usr/造婷用痃local/nginx/logs /usr/local/nginx/conf

7、停止nginx容器[root@localhost /]# docker stop nginx

9、创建并运行nginx容器[root@localhost /]# docker run -蟠校盯昂d -p 80:80 --name nginx -v /usr/local/nginx/www:/usr/share/nginx/html -v /usr/local/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /usr/local/nginx/logs:/var/log/nginx --restart=always nginx:latest

11、查看容器的ip地址[root@localhost /]# docker inspect --format='{{.NetworkSettings.IPAddress}}' nginx

13、开启firewalld(可选,未开启时执行)[root@localhost /]# systemctl start firewalld

15、重新载入[root@localhost /]# firewall-cmd --reload

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:37
阅读量:24
阅读量:91
阅读量:24
阅读量:69