docker registry接入ceph Swift API

简介:

ceph存储操作

创建用户

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(ceph-rgw)[root@ceph-node01 /] # radosgw-admin user create --uid=registry --display-name="registry" 
{
"user_id" "registry" ,
"display_name" "registry" ,
"email" "" ,
"suspended" : 0,
"max_buckets" : 1000,
"auid" : 0,
"subusers" : [],
"keys" : [
{
"user" "registry" ,
"access_key" "3JHGH0WDQO5LG2HTF6UX" ,
"secret_key" "jt8KzI8XUagl2KTX0XkdFTP39mkcD9774ql4ZbDp"
}
],
"swift_keys" : [],
"caps" : [],
"op_mask" "read, write, delete" ,
"default_placement" "" ,
"placement_tags" : [],
"bucket_quota" : {
"enabled" false ,
"max_size_kb" : -1,
"max_objects" : -1
},
"user_quota" : {
"enabled" false ,
"max_size_kb" : -1,
"max_objects" : -1
},
"temp_url_keys" : []
}

创建swift用户

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
(ceph-rgw)[root@ceph-node01 /] # radosgw-admin subuser create --uid=registry --subuser=registry:swift --access=full 
{
"user_id" "registry" ,
"display_name" "registry" ,
"email" "" ,
"suspended" : 0,
"max_buckets" : 1000,
"auid" : 0,
"subusers" : [
{
"id" "registry:swift" ,
"permissions" "full-control"
}
],
"keys" : [
{
"user" "registry" ,
"access_key" "3JHGH0WDQO5LG2HTF6UX" ,
"secret_key" "jt8KzI8XUagl2KTX0XkdFTP39mkcD9774ql4ZbDp"
}
],
"swift_keys" : [
{
"user" "registry:swift" ,
"secret_key" "dfRwo00KoOTw3IJJJCrRpFqIinaEFSEvxCuBxXa5"
}
],
"caps" : [],
"op_mask" "read, write, delete" ,
"default_placement" "" ,
"placement_tags" : [],
"bucket_quota" : {
"enabled" false ,
"max_size_kb" : -1,
"max_objects" : -1
},
"user_quota" : {
"enabled" false ,
"max_size_kb" : -1,
"max_objects" : -1
},
"temp_url_keys" : []
}

配置registry访问

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
storage:
     swift: 
        authurl: http: //192 .168.48.213:6780 /auth/v1
        username: registry:swift 
        password: dfRwo00KoOTw3IJJJCrRpFqIinaEFSEvxCuBxXa5
        container: registry
     cache:
        layerinfo: inmemory
     maintenance:
        uploadpurging:
            enabled:  false
     delete:
        enable true
health:
     storagedriver:
         enabled:  true
         interval: 10s
         threshold: 3

据java接口可知必要参数为:username,password,authurl

http://docs.ceph.com/docs/master/radosgw/swift/java/

测试验证

1
2
3
4
5
6
7
8
9
[root@gx-yun-084069 ~] # docker push paas/golang:1.6.2
The push refers to a repository [registry.vclound.com /paas/golang ]
d966b83f8000: Pushed 
6fe25112314d: Pushed 
4d8ac510a6fe: Pushing [===================> ] 126.2 MB /318 .1 MB
5aee74d2e9d0: Pushing [=========================> ] 68.6 MB /134 .4 MB
338cb8e0e9ed: Pushing [=========================> ] 67.77 MB /131 .2 MB
d1c800db26c7: Pushed 
42755cf4ee95: Pushing [==============================> ] 75.38 MB /125 .1 MB

查看ceph是否已上有golang

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(ceph-rgw)[root@ceph-node01 /] # rados lspools
rbd
.rgw.root
default.rgw.control
default.rgw.data.root
default.rgw.gc
default.rgw.log
volumes
default.rgw. users .uid
default.rgw. users .keys
default.rgw.meta
default.rgw. users .email
default.rgw. users .swift
default.rgw.buckets.index
default.rgw.buckets.data
  
  
(ceph-rgw)[root@ceph-node01 /] # rados --pool default.rgw.buckets.data ls|grep golang
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_manifests/tags/1 .6.2 /current/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_uploads/32bfc9f1-d07f-4def-8fc7-3fd4099e2607/startedat
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_layers/sha256/0ffc1204e0abead91aa6678abffa44739455c7b95b96b108eefc2f29d6001fdf/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_layers/sha256/a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_layers/sha256/ab30c63719b10dd434ddbe896879bd9b637fe4e16749a94d3dc827450dc2a437/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_uploads/5e016d36-55dc-41c9-945d-85c18399723e/startedat
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_layers/sha256/d8a921df8ce9d2b00d139bc78f0a2036f1960204281570d5794ad0e0c9f32ceb/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_uploads/377a0560-0beb-4f2d-87c2-2173bfa15e3f/data
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_layers/sha256/b0850b14d0d144ceecb975d0b296d7630c5c8658054535164c8a5ea55a3fa627/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_manifests/tags/1 .6.2 /index/sha256/3b746975638c2640b41de2f6669fb4a6d24d5c218c008b359d21148a580b2178/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_uploads/32bfc9f1-d07f-4def-8fc7-3fd4099e2607/data
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_uploads/5e016d36-55dc-41c9-945d-85c18399723e/data
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_uploads/d51b6005-d7d2-4981-ad27-284914e21159/startedat
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_manifests/revisions/sha256/3b746975638c2640b41de2f6669fb4a6d24d5c218c008b359d21148a580b2178/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_uploads/377a0560-0beb-4f2d-87c2-2173bfa15e3f/startedat
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_layers/sha256/c6072700a24252bd71f6c5d2cabf5978ddf324a959b05bad417d8b3789f8df33/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_layers/sha256/d34bc98c277053d749016539968fbde53f0e095713988ccc780505b9c3d37187/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_manifests/revisions/sha256/3b746975638c2640b41de2f6669fb4a6d24d5c218c008b359d21148a580b2178/signatures/sha256/134a8ac27aa47d9ef953be3968d2c899cb1ed8efd7a3e4ce066abeba2c8a3b98/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_uploads/d51b6005-d7d2-4981-ad27-284914e21159/data
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_layers/sha256/8ecba0e9bd481f27b172d1a0ff04269981946aa1aaa91da3b2f41380031ed865/link
208d0ff3-767d-4edc-ac3f-fb55689374cb.44103.1_files /docker/registry/v2/repositories/paas/golang/_layers/sha256/5c90d4a2d1a8dfffd05ff2dd659923f0ca2d843b5e45d030e17abbcd06a11b5b/link

pull镜像

1
2
3
4
5
6
7
8
9
10
11
[root@gx-yun-084069 ~] # docker pull  paas/golang:1.6.2
Trying to pull repository registry.vclound.com /paas/golang  ... 
1.6.2: Pulling from registry.vclound.com /paas/golang
5c90d4a2d1a8: Already exists 
ab30c63719b1: Already exists 
c6072700a242: Already exists 
0ffc1204e0ab: Already exists 
d8a921df8ce9: Already exists 
d34bc98c2770: Already exists 
Digest: sha256:3b746975638c2640b41de2f6669fb4a6d24d5c218c008b359d21148a580b2178
Status: Downloaded newer image  for  registry.vclound.com /paas/golang :1.6.2


本文转自 qwjhq 51CTO博客,原文链接:http://blog.51cto.com/bingdian/1893658

相关文章
|
7月前
|
存储 数据可视化 数据安全/隐私保护
使用 Docker Compose 部署 Docker Registry
【1月更文挑战第2天】 在内网环境中,我们期望能够在本地共享镜像。为了解决这一问题,Docker Registry成为了我们的救星。Docker Registry是一个用于存储和管理Docker镜像的开源工具。通过在本地部署Docker Registry,您可以轻松地构建、存储和分享自己的Docker镜像。
429 3
使用 Docker Compose 部署 Docker Registry
|
7月前
|
数据可视化 Linux API
如何在Linux使用docker部署Swagger Editor并实现无公网IP远程协同编辑API文档
如何在Linux使用docker部署Swagger Editor并实现无公网IP远程协同编辑API文档
|
7月前
|
数据可视化 Linux API
使用Docker安装部署Swagger Editor并远程访问编辑API文档
使用Docker安装部署Swagger Editor并远程访问编辑API文档
137 0
|
3月前
|
存储 API Swift
Ceph Reef(18.2.X)之Swift操作对象存储网关
这篇文章详细介绍了Ceph Reef(18.2.X)中通过Swift API操作对象存储网关的方法,包括创建用户、子用户、配置环境变量、以及使用swift命令行工具进行存储桶和对象的管理。
42 7
Ceph Reef(18.2.X)之Swift操作对象存储网关
|
2月前
|
监控 安全 API
Docker + .NET API:简化部署和扩展
Docker + .NET API:简化部署和扩展
42 0
|
2月前
|
监控 安全 API
最完美的扩展Docker + .NET API:简化部署和扩展
最完美的扩展Docker + .NET API:简化部署和扩展
92 0
|
3月前
|
运维 数据安全/隐私保护 Docker
Docker自建仓库之Docker Registry部署实战
关于如何使用Docker Registry镜像搭建本地私有Docker仓库的实战教程,包括了下载镜像、创建授权目录和用户名密码、启动Registry容器、验证端口和容器、测试登录仓库、上传和下载镜像的详细步骤。
1101 5
|
7月前
|
JSON API 数据处理
【Swift开发专栏】Swift中的RESTful API集成实战
【4月更文挑战第30天】本文探讨了在Swift中集成RESTful API的方法,涉及RESTful API的基础概念,如HTTP方法和设计原则,以及Swift的网络请求技术,如`URLSession`、`Alamofire`和`SwiftyJSON`。此外,还强调了数据处理、错误管理和异步操作的重要性。通过合理利用这些工具和策略,开发者能实现高效、稳定的API集成,提升应用性能和用户体验。
148 0
|
4月前
|
安全 Linux 数据安全/隐私保护
详解如何登录Docker Registry
【8月更文挑战第24天】
372 0
|
5月前
|
应用服务中间件 API 数据库
Docker 安装 KONG 带你玩转 API 网关
**摘要:** 在微服务架构中,API网关Kong作为流行开源选择,提供身份验证、安全和流量控制等功能。通过Docker部署Kong简单高效。步骤包括:创建Docker网络,部署PostgreSQL数据库,初始化Kong数据库,启动Kong容器,并检查运行状态。此外,安装Konga管理界面便于直观管理Kong。使用Docker命令行,逐步设置环境变量和网络连接,即可完成安装。当不再需要时,可清理相关容器和网络。Kong结合Konga,为API管理提供强大且用户友好的解决方案。
319 1
下一篇
DataWorks