虚拟机Linux下centOs安装命令 #yum install -y docker
查看版本 #docker version
启动docker #systemctl start docker
查看镜像:docker images
拉取第一个镜像docker pull hello-world
运行第一个容器docker run hello-world
拉取nginx:docker pull hub.c.163.com/library/nginx:latest
(前台启动docker run hub.c.163.com/library/nginx没啥用,ctrl+c将其停掉)
需要在后台运行(docker run -d -p 8080:80 hub.c.163.com/library/nginx)
docker run -d -P 8080:80 hub.c.163.com/library/nginx 随机指定端口 结合docker ps查看