搭建harbor私有仓库报错:unable to configure the Docker daemon with file /etc/docker/daemon.json
·
在搭建harbor时,客户端需要上传镜像至harbor服务器端,修改配置文件时/usr/lib/systemd/system/docker.service,然后重启docker服务的时候出现报错,通过看日志报错项,下面是报错代码
tail -f /var/log/messages
Mar 29 14:57:32 localhost dockerd: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: insecure-registries: (from flag: [192.168.241.3], from file: [192.168.241.20:5000])
解决思路:
通过日志的报错项提示在/etc/docker/daemon.json这个文件已经规定了一个仓库
1、既然日志提示/etc/docker/daemon.json有问题,那我们就去看下
cat /etc/docker/daemon.json
{
"insecure-registries":["192.168.241.20:5000"],
"registry-mirrors": ["https://9it5um2j.mirror.aliyuncs.com"]
}
这里发现这里有一个私有仓库的地址了
2、直接删除私有仓库这行
[root@localhost ~]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://9it5um2j.mirror.aliyuncs.com"]
}
3、再次重启docker服务
systemctl daemon-reload
systemctl restart docker
问题解决~~~
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)