- 首先你得需要有一个虚拟机,我的配置如图:
- 安装docker的工具
sudo yum install -y yum-utils device-mapper-persistent-data lvm2

- 指定阿里云的仓库
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

- 更新仓库源信息
sudo yum makecache fast

- 从阿里云镜像上下载docker
sudo yum -y install docker-ce
- docker服务化
sudo service docker start

- 启动服务
service docker start

- 看一下docker是否启动成功
docker version

- 从镜像中拿来hello-world
docker pull hello-world
- 运行一下
docker run hello-world
当出现 "Hello from Docker!" 就说明运行成功了