Docker安装Nginx
搜索镜像
docker search nginx
拉取镜像
docker pull nginx
查看镜像
[root@iz2ze7kchfwcvrdgoe1tr6z ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
#Nginx 成功下载
nginx latest 62d49f9bab67 7 days ago 133MB
centos latest 300e315adb2f 4 months ago 209MB
启动镜像
# -d 以后台方式启动nginx
# --name 给nginx容器起一个名字叫做 mynginx
# -p 将nginx 容器中默认的端口号80 映射为本机的3344
docker run -d --name mynginx -p 3344:80 nginx
查看启动状态
运行测试Nginx
#访问本机的 3344端口
curl localhost:3344