docker 安装nginx

下载nginx镜像

从网易云镜像中心下载https://c.163yun.com/hub#/library/repository/info?repoId=2967
docker pull hub.c.163.com/library/nginx:latest

查看nginxjingxiang

docker images

给nginx分配端口,并运行

容器中nginx默认占用80,我们把容器的80端口映射到本机18080端口
docker run -d -p 18080:80 --name nginx hub.c.163.com/library/nginx

访问:http://localhost:18080/

posted @ 2020-02-27 15:14  Levcon  阅读(187)  评论(0)    收藏  举报