Docker 容器化部署 Nginx 实战教程

发布时间:2025-09-15 | 分类:容器技术 | 阅读:286

一、前提条件 1. 已安装 Docker(若未安装,可执行 `yum install docker -y`(CentOS)或 `apt install docker -y`(Ubuntu)); 2. 服务器已开放 80 端口(HTTP)或 443 端口(HTTPS)。

二、部署步骤 1. 拉取 Nginx 镜像 执行命令: docker pull nginx:latest # 拉取最新版 Nginx 镜像

三、docker运行nginx镜像 1.执行命令: docker run --name nginx1 -d -p 80:80 -v /local_path:contaner_path nginx:latest