harbor 仓库的管理

harbor 仓库搭建成功并登录后:

在 harbor 仓库选择新建项目 test_harbor,如图所示:

 docker 默认是按 https 请求的,由于搭的私有库是 http 的,所以需要修改 docker 配置,添加信任仓库

[root@centos7 ~]# vim /lib/systemd/system/docker.service

[Service]

ExecStart=/usr/bin/dockerd --insecure-registry=192.168.121.105

ExecStartPost=/sbin/iptables -I FORWARD -s 0.0.0.0/0 -j ACCEPT

////需修改,根据自己的 docker 路径和 IP 地址进行修改

[root@centos7 ~]# systemctl daemon-reload

[root@centos7 ~]# systemctl restart docker.service

[root@centos7 ~]# cd harbor/

[root@centos7 harbor]# docker-compose restart

// 保证每个容器都运行正常

命令行登录 harbor 仓库

 修改镜像名,上传镜像。(此处以 nginx 镜像为例)

 上传成功后在 harbor 页面查看,如图所示:

posted @ 2021-12-01 15:52  demoduan  阅读(677)  评论(0编辑  收藏  举报