1.拉取nginx镜像
命令:
docker search nginx
docker pull nginx
[root@centos79 ~]# docker search nginx
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
nginx Official build of Nginx. 19325 [OK]
unit Official build of NGINX Unit: Universal Web … 19 [OK]
nginxinc/nginx-unprivileged Unprivileged NGINX Dockerfiles 136
nginx/nginx-ingress NGINX and NGINX Plus Ingress Controllers fo… 86
nginx/nginx-prometheus-exporter NGINX Prometheus Exporter for NGINX and NGIN… 33
nginxinc/ng
本文档详细介绍了如何在Docker中安装和运行nginx。首先通过docker search和docker pull命令获取nginx镜像,接着创建volume挂载目录,分别用于/etc/nginx、/var/log/nginx和/usr/share/nginx。然后使用docker run命令启动容器,将端口映射,并挂载volume。最后,可以通过http://172.20.10.12进行验证。
订阅专栏 解锁全文
980

被折叠的 条评论
为什么被折叠?



