前言
搭建的 harbor 仓库为 http 协议,在本地登录后,推送镜像发生如下报错:
docker push 192.168.xx.xx/test/grafana:v10.1.1
The push refers to repository [192.168.xx.xx/test/grafana]
Get "https://192.168.xx.xx/v2/": dialing 192.168.xx.xx:443 matches static system exclude: connecting to 192.168.xx.xx:443: dial tcp 192.168.xx.xx:443: connect: connection refused
docker push 192.168.xx.xx:80/test/grafana:v10.1.1
The push refers to repository [192.168.xx.xx:80/test/grafana]
An image does not exist locally with the tag: 192.168.xx.xx:80/test/grafana
正确方式
将镜像名称改为带 :80
端口号的镜像
docker tag 192.168.xx.xx/test/grafana:v10.1.1 192.168.xx.xx:80/test/grafana:v10.1.1
再次push 镜像
docker push 192.168.xx.xx:80/test/grafana:v10.1.1
The push refers to repository [192.168.xx.xx:80/test/grafana]
3e1d7faaa459: Pushed
52fbdb6a467e: Pushed
9a4bf5224a49: Pushed
8d24970dfa0c: Pushed
ce10e25b48eb: Pushed
403eb005872a: Pushed
e150366f85e6: Pushed
205afe5dc400: Pushed
44cb0da43c9f: Pushed
36b50b131297: Pushed
v10.1.1: digest: sha256:2b2500517d81c4590fe1868626b99396aa50b1317728a71326765642a461532a size: 2416
成功!!