直接使用 yum 安装,简单快捷
#安装 Docker
yum -y install docker
#启动 Docker 后台服务
service docker start
#测试运行 hello-world,出现 hello world 就证明安装正常了
docker run hello-world
docker ps -a #查看所有容器
docker images #查看镜像
###容器相关
docker run
docker start
docker stop
docker restart
docker rm -f 1e560fca3906 #删除容器
docker container exec -it f0b1c8ab3633 /bin/bash #进入容器 exit退出
###镜像相关
docker pull httpd #拉取镜像
docker run httpd #使用镜像
docker rmi hello-world #删除镜像