1、设置docker-ce配置文件
[root@localhost ~]# sudo vi /etc/yum.repos.d/docker-ce.repo
2、在docker-ce.repo 文件中添加以下内容:
[docker-ce] name=Docker CE Stable - $basearch baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/8/$basearch/stable/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg enabled=1
3、安装docker:
[root@localhost ~]# sudo dnf update [root@localhost ~]# sudo dnf install -y docker-ce docker-ce-cli containerd.io [root@localhost ~]# sudo systemctl start docker [root@localhost ~]# sudo systemctl enable docker [root@localhost ~]# docker --version
4、配置docker镜像加速器
{ "registry-mirrors": [ "https://dockerhub.icu", "https://docker.chenby.cn", "https://docker.1panel.live", "https://docker.awsl9527.cn", "https://docker.anyhub.us.kg", "https://dhub.kubesre.xyz" ] }
5、重启docker服务
[root@localhost ~]# sudo systemctl restart docker
标签:root,sudo,ce,centos8.5,https,docker,安装,localhost From: https://www.cnblogs.com/fangts/p/18358569