天天看點

往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
s      

解決方案:

# 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
      
上一篇: Kotlin
下一篇: lucene

繼續閱讀