centos7.0以上的docker怎么安装呢?

centos7安装docker
1.确定centos版本

2.yum安装gcc相关
①能上外网

② yum -y install gcc

③ yum -y install gcc-c++

3.安装所需软件包
yum install -y yum-utils device-mapper-persistent-data lvm2

4.设置stable镜像仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

5.更新yum软件包索引
yum makecache fast

6.安装docker-ce
yum -y install docker-ce

7.启动docker
systemctl start docker
8.测试
docker version
docker run hello-world
9.配置镜像加速
mkdir -p /etc/docker
vim /etc/docker/daemon.json
#网易云
{“registry-mirrors”: [“http://hub-mirror.c.163.com”] }
#阿里云
{
“registry-mirrors”: [“https://{自已的编码}.mirror.aliyuncs.com”]
}
systemctl daemon-relaod 重新加载守护进程
systemctl restart docker 重新启动docker
10.卸载docker
systemctl stop docker
yum -y remove docker-ce
rm -rf /var/lib/docker

猜你喜欢

转载自blog.csdn.net/weixin_44703894/article/details/113348366