首页 > Web开发 > 详细

往harbor上传镜像

时间:2021-07-19 22:32:21      阅读:15      评论:0      收藏:0      [点我收藏+]

下载镜像并给镜像打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

往harbor上传镜像

原文:https://www.cnblogs.com/obitoma/p/15031228.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!