Docker的Liunx版本快速安装步骤
Docker 支持以下的 64 位 CentOS 版本:
- CentOS 7
- CentOS 8
- 更高版本
我这里使用阿里云服务器CentOS 7.6 的版本进行安装的。
一、在线安装需要的安装包
yum install -y yum-utils
二、设置镜像的仓库
使用官方源地址(比较慢)
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
国内的阿里云源地址(无法安装的使用清华大学源地址)
yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo国内的清华大学源地址
yum-config-manager \
--add-repo \
https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo
三、更新软件包的索引
yum makecache fast
四、安装最新版本的 Docker Engine-Community 和 containerd
yum install docker-ce docker-ce-cli containerd.io
五、启动Docker
systemctl start docker
六、查看Docker是否安装成功以及版本信息
docker vsersion
七、通过运行 hello-world 镜像来验证是否正确安装了 Docker Engine-Community 。
docker run hello-world
八、查看下载的hello-world 镜像
docker images
到这里就安装完成啦!