- 使用DNF添加并启用官方Docker CE存储库。在终端窗口中输入以下命令:
-
安装containerd.io包手动
-
安装最新版docer ce
-
启用docker
-
添加当前用户加入docker用户组
-
关闭防火墙
-
重新登录,可以使用了
-
修改阿里镜像:修改前:
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/contentdir/contentdir/releasever/AppStream/$basearch/os/
修改后:
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=http://mirrors.aliyun.com/centos/releasever/AppStream/releasever/AppStream/basearch/os/
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.10-3.2.el7.x86_64.rpm
sudo dnf install docker-ce -y --nobest
sudo systemctl enable --now docker
sudo usermod -aG docker $USER
sudo systemctl disable firewalld
docker images
[Author@localhost yum.repos.d]$ cat CentOS-Stream-AppStream.repo
# CentOS-Stream-AppStream.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client. You should use this for CentOS updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.
[appstream]
name=CentOS Stream $releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra
baseurl=http://mirror.aliyun.org/$contentdir/$stream/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial