现在yum源里的docker比较旧,安装最新的docker-ce
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-ce
sudo systemctl enable docker
sudo systemctl start docker
修改启动参数
如果是私建仓库,没有配置SSL,应该添加insecure-registries.否则会报连接拒绝。添加后可以pull,如果要push必须登录!
vi /etc/docker/daemon.json添加。自己添加的镜像仓库在pull必须加全名。
{
"insecure-registries": ["registry.cacec.com.cn"]
}
"registry-mirrors": ["https://registry.cacec.com.cn"]
查看docker启动参数
systemctl daemon-reload && systemctl restart docker
ps aux | grep docker