注:
Harbor镜像仓库地址:172.168.1.249
# 获取项目信息
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://172.168.1.249/api/projects/2"
# 获取所有项目信息
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://172.168.1.249/api/projects?"
# 搜索镜像
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://172.168.1.249/api/search?q=asset"
# 删除项目
curl -u "admin:Harbor12345" -X DELETE -H "Content-Type: application/json" "http://172.168.1.249/api/projects/3"
# 创建项目
curl -u "admin:Harbor12345" -X POST -H "Content-Type: application/json" "http://172.168.1.249/api/projects" -d @createproject.json
createproject.json为文件名,文件内容参考createproject.json
# 0为私有
{
"project_name": "项目名",
"public": 0
}
# 创建用户
curl -u "admin:Harbor12345" -X POST -H "Content-Type: application/json" "http://172.168.1.249/api/users" -d @user.json
文件内容参考user.json
{
"user_id": 5,
"username": "test",
"email": "test@qq.com",
"password": "Harbor12345",
"realname": "test",
"role_id": 0
}
# 获取用户信息,除admin外
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://172.168.1.249/api/users"
# 查看当前用户信息
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://172.168.1.249/api/users/current"
# 删除用户,3是用户user_id
curl -u "admin:Harbor12345" -X DELETE -H "Content-Type: application/json" "http://172.168.1.249/api/users/34"
# 修改用户密码
curl -u "admin:Harbor12345" -X PUT -H "Content-Type: application/json" "http://172.168.1.249/api/users/4/password" -d @uppwd.json
# 查看项目相关角色
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://172.168.1.249/api/projects/2/members/"
# 项目添加角色
curl -u "jaymarco:Harbor123456" -X POST -H "Content-Type: application/json" "http://172.168.1.249/api/projects/2/members/" -d @role.json
# 查看镜像
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://172.168.1.249/api/repositories?project_id=2&q=镜像名"
# 删除镜像
curl -u "admin:Harbor12345" -X DELETE -H "Content-Type: application/json" "http://172.168.1.249/api/repositories/marktrace%2Fasset/tags/latest"
# 获取镜像标签
curl -s -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://172.168.1.249/api/repositories/marktrace%2Fasset/tags/" |grep "digest" -C 2 |grep ""name""
• 输入编号:7484,直达文章
• 输入m|M,直达目录列表
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
@Harbor镜像仓库安装及使用
Harbor一、Harbor简介Harbor(港口,港湾)是一个用于存储和分发Docker镜像的企业级Registry服务器
docker harbor docker-compose nginx 服务器 -
【Harbor】Harbor镜像仓库
harbor仓库快速构建,并且文档中也有相关软件包,少量配置,可以一键安装
docker harbor 镜像仓库 kubernetes -
nacos不用mysql行吗
浅谈注册中心选型搭建Nacos高可用集群准备工作正式搭建遇到的问题总结浅谈注册中心选型 在注册中心的选型上有多种选择,Spring Cloud Netflix技术栈会优选Eureka(当然也可以选择Consul),而基于Dubbo的服务注册与发现一般选择ZooKeeper较多。 注册中心选型对比 Eureka基于AP,Eureka Server集群中任何一台机器宕机后整个集群
nacos不用mysql行吗 linux安装nacos mysql集群搭建 nacos 安装 nacos 集群