三、CentOS8/7.5安装Docker CE并配置镜像
1、序言
禁用防火墙
systemctl stop firewalld
systemctl disable firewalld
2、卸载旧的Docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
3、设置存储库
sudo yum install -y yum-utils
# 【不推荐】
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
# 【推荐】
sudo yum-config-manager \
--add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4、安装Docker
yum install docker-ce docker-ce-cli containerd.io
2020-07-18更新
【问题】CentOS8安装Docker出现下错误
.....
- package containerd.io-1.2.4-3.1.el7.x86_64 is filtered out by modular filtering
- package containerd.io-1.2.5-3.1.el7.x86_64 is filtered out by modular filtering
- package containerd.io-1.2.6-3.3.el7.x86_64 is filtered out by modular filtering
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
【解决方法】
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.1.el7.x86_64.rpm
yum -y install ./containerd.io-1.2.13-3.1.el7.x86_64.rpm
5、启动Docker
systemctl start docker
6、验证Docker是否安装成功
docker run hello-world
7、配置阿里去容器镜像加速器
1)创建daemon.json文件并配置内容
{
"registry-mirrors": ["https://******.mirror.aliyuncs.com"]
}
2)重启docker
sudo systemctl daemon-reload
sudo systemctl restart docker
3)、使用docker info查看镜像是否配置成功
......
Registry Mirrors:
https://******.mirror.aliyuncs.com/
我是夕阳何处寻,期待和优秀的你一起同行!
夕阳何处寻
2019年07月22日
请登录后再评论