harbor仓库搭建实践
2019-10-18 本文已影响0人
欧几里德
下载harbor:https://github.com/goharbor/harbor/releases
这边以harbor-1.8.2为例

[root@gitlab home]# tar -xf harbor-offline-installer-v1.8.2.tgz
修改配置文件
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://rwxhpxqi.mirror.aliyuncs.com"],
"live-restore": true ,
"insecure-registries":["172.23.23.87"]
}
然后执行如下命令
//重启docker
systemctl daemon-reload
service docker restart
//重启harbor
docker-compose stop
docker-compose up -d
下载docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-(uname -m)" -o /usr/sbin/docker-compose && chmod +x /usr/sbin/docker-compose
然后依次执行



启动完成后 登录harbor页面,默认用户名密码 admin/Harbor12345
登录页面后创建一个project测试下上传功能

使用docker连接,上传一个镜像测试,输入自己的账户名密码。

登录成功后,上传一个镜像
harbor项目中有命令复制

先打tag,在上传,以我本机nginx为例

出现这个报错是因为没有给项目添加用户,本项目是用admin用户创建的,而我docker连接的是test用户,添加用户上传即可

然后上传

上传成功,harbor上查看

已成功上传。
文档参考:
https://github.com/goharbor/harbor/blob/master/docs/installation_guide.md