尝试推送到Harbor注册表时连接被拒绝



我尝试在Ubuntu 20上使用Harbor作为Docker注册表。我遵循了官方文件。因为我想通过HTTP连接到Harbor,所以我遵循了那里的说明。

我仍然得到这样的错误:

$ sudo docker push harbor_example:5000/ubuntu
Using default tag: latest
The push refers to repository [harbor_example:5000/ubuntu]
Get http://harbor_example:5000/v2/: dial tcp :5000: connect: connection refused

我在设置Harbor和/或Docker时错过了什么吗?

问好

当您在/etc/docker/daemon.json

中特别添加端口80时,它会起作用
{
"insecure-registries" : ["harbor_example:80", "0.0.0.0"]
}
[root@edge harbor]# cat /etc/docker/daemon.json
{
"insecure-registries" : ["0.0.0.0/0"]
}
[root@edge harbor]# systemctl daemon-reload 
[root@edge harbor]# systemctl restart docker
[root@edge harbor]# docker login -uadmin -pHarbor12345 http://192.168.200.45
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
[root@edge harbor]# 

最新更新