Harbor操作指引
harbor
Harbor 是一个开源的容器镜像仓库,用于存储和管理 Docker 镜像和其他容器镜像。 * 容器镜像仓库、存储和管理 Docker 镜像和其他容器镜像 * 有什么特点:支持多种镜像格式、易于使用、安全性和访问控制
项目地址:https://gitcode.com/gh_mirrors/ha/harbor

·
下面以一个具体的例子介绍Harbor的基本操作
1)创建项目: 项目 → 新建项目
管理员提供账号密码之后,用户自行登陆系统创建项目,本案例创建了一个test项目
项目的作用:pull镜像和push镜像都需要指定项目,否则操作不成功
2)本地docker登陆用户
先输入docker login testing.com,在输入账号密码, 显示Login Succeeded 则登陆成功
登陆报错如下
# docker login testing.com
Username: admin
Password:
Error response from daemon: Get https://testing.com/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
报错原因:Docker自从1.3.X之后docker registry交互默认使用的是HTTPS,但是我们搭建私有镜像默认使用的是HTTP服务,所以与私有镜像交时出现以上错误。
报错解决:
修改Docker的配置文件/etc/docker/daemon.json
加上"insecure-registries":["testing.com"]
# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://k728i8z5.mirror.aliyuncs.com"],
"insecure-registries":["testing.com"]
}
docker服务重启:
systemctl daemon-reload
systemctl restart docker
3)从本地push镜像到制品库的test项目
a、tag命令修改镜像名称
docker tag nginx testing.com/test/nginx:v1
必须要按该格式修改才能对应上harbor服务
注:
nginx 为本地原来的镜像名
testing.com 为harbor的地址
test 为harbor中要接收镜像的项目
v1为上传到harbor的镜像版本号
b、把修改名称以后的镜像push到harbor中
docker push testing.com/test/nginx:v1
上传成功如下:
若上传的镜像名跟版本号在harbor中已存在,则最新上传的会覆盖原来的镜像,原镜像在harbor中的tag会标空
c、登陆harbor,在系统中可以看到上传的镜像
项目→点击test可以查看项目下的所有镜像
4)从制品库pull httpd镜像到本地
docker pull testing.com/test/centos:v1
注:
testing.com为harbor的地址
test 为harbor中镜像所在的项目
centos为镜像名
v1为镜像的版本号




Harbor 是一个开源的容器镜像仓库,用于存储和管理 Docker 镜像和其他容器镜像。 * 容器镜像仓库、存储和管理 Docker 镜像和其他容器镜像 * 有什么特点:支持多种镜像格式、易于使用、安全性和访问控制
最近提交(Master分支:6 个月前 )
45659070
Fix integration issue with UI
Signed-off-by: stonezdj <stone.zhang@broadcom.com> 9 天前
add0b600
chore(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp](https://github.com/open-telemetry/opentelemetry-go) from 1.31.0 to 1.34.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.31.0...v1.34.0)
---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 11 天前
更多推荐
所有评论(0)