往harbor上傳鏡像


下載鏡像並給鏡像打tag

[root@hdss7-200 harbor]# docker pull nginx:1.7.9
[root@hdss7-200 harbor]# docker images |grep 1.7.9
[root@hdss7-200 harbor]# docker tag 84581e99d807 harbor的ip/public/nginx:v1.7.9

登錄harbor並上傳到倉庫

[root@hdss7-200 harbor]# docker login harbor的ip
[root@hdss7-200 harbor]# docker push harbor的ip/public/nginx:v1.7.9

報錯

[root@obitomayyds docker]# docker login harbor的ip
Username: admin
Password:
Error response from daemon: Get http://172.26.130.201/v2/: dial tcp 172.26.130.201:80: connect: connection refused

解決方案:

# find / -name docker.service -type f
/etc/systemd/system/docker.service

vim /etc/systemd/system/docker.service


修改配置文件, 增加  --insecure-registry=harbor的ip 選項
[Service]下!!!ExecStart這一行!!!
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
#ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecStart=/usr/bin/dockerd --insecure-registry=172.26.130.201
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

重新啟動服務

systemctl daemon-reload
 
systemctl restart docker


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM