文章以CentOS8.5.X.X 版本安装Docker为例
一、Docker官网链接:
https://www.docker.com/
二、查看自己的centos版本信息
- 在centos桌面上右键“打开终端”,输入以下命令分别显示centos系统的版本和内核版本信息
cat /etc/redhat-release
uname -a
三、在终端中执行如下命令
yum -y install gcc
yum -y install gcc-c++
四、安装yum-utils软件包
yum install -y yum-utils
五、设置镜像仓库
注意:docker的服务器在国外,国内访问非常慢,我们选择从阿里云上拉取仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
六、更新yum软件包索引
yum makecache timer
注意:我这里是centos8.x.x版本,如果是centos7.x.x版本,命令为:
yum makecache fast
七、安装 Docker 引擎
yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
八、启动 Docker
systemctl start docker
ps -ef | grep docker
九、执行hello-world
docker run hello-world