安装docker
自行下载 安装
安装Harbor
环境准备
Python: 3.10.4
docker: Docker version 20.10.14, build a224086
下载
下载地址:https://github.com/goharbor/harbor/releases
本文使用
安装
解压->修改harbor.yml->安装
修改配置
可以选择创建data、log两个文件夹,作为数据日志保存地址;也可以默认;(推荐自定义)
没有https 需要移除 配置
安装
解压目录下 输入./install.sh
测试访问
根据yml配置访问WEB界面
默认的账号密码为:admin/Harbor12345
上传镜像
配置镜像源
$ vim /etc/docker/daemon.json
# 追加,其中 xxx.xxx.xxx:pppp 表示 harbor 的地址
{
"insecure-registries": ["xxx.xxx.xxx:pppp"]
}
重新加载进程
$ systemctl daemon-reload
启动/重启docker
systemctl restart docker
登录
docker login harbor地址:port -u {用户名}
Password: {输入密码}
Login Succeeded
可能报错
Error response from daemon: Get “https://harbor地址:port/v2/”: http: server gave HTTP respons
e to HTTPS client
修改 配置文件 添加 以下配置
{
"insecure-registries": ["自己的harbor地址:port"]
}
tag镜像
$ docker tag 镜像名:TAG harbor地址/项目/镜像名:TAG
推送镜像
$ docker push harbor地址/项目/镜像名:TAG
The push refers to repository [harbor地址/项目/镜像名]
7ff6d4708d5c: Pushed
60a591861d00: Pushed
f24a1bf74d57: Pushed
fbcdde49c307: Pushed
815aceaef252: Pushed
a2192106d0ba: Pushed
1.0.0: digest: sha256:c1c24ce3cfd45e9aa13bd57ca1d5d1ab8dbc0f9b56bd04eb5744d37d2469bac5 size: 1573
参考文档
https://blog.csdn.net/tsuiearl/article/details/117528564
https://blog.csdn.net/tsuiearl/article/details/117528564