通过脚本创建Content Selector和Privileges,以将Docker注册表分为项目拥有的名称空间 [英] Create Content Selector and Privileges via script for separating a docker registry into project owned namespaces

查看:115
本文介绍了通过脚本创建Content Selector和Privileges,以将Docker注册表分为项目拥有的名称空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否知道是否可以通过脚本为Nexus Repository Manager OSS创建内容选择器和内容选择器特权?

Do you know if there is any way to create content selectors and content selector privileges via script for Nexus Repository Manager OSS?

在此先感谢您的回答:-)

Thanks in advance for every answer :-)

我的想法是将托管的Docker存储库分为单独的(受保护的)命名空间(针对每个产品/团队/项目)-我不想手动执行以下步骤;更好的方法是为此创建一个脚本:

My idea is to divide a hosted Docker Repository into separated (protected) namespaces (for each product/team/project) - I do not want to do the following steps manually; a better approach is to create a script for that:

1创建内容选择器 format == "docker" && (path == "/v2/" || path =^ "/v2/PROJECTNAME/")

2创建内容选择器权限 使用在步骤1中创建的选择器,然后选择一个docker repo.

2 Create Content Selector Privilege Use the selector created in step 1 and choose a docker repo.

3创建角色 创建一个角色并授予在步骤2中创建的特权

3 Create role Create a role and grant the privilege created in step 2

4创建用户 创建一个具有随机生成的密码的用户,并将第3步中的角色授予新创建的用户.

4 Create user Create a user with a randomly generated pwd and grant the role from step 3 to newly created user.

项目只能使用该用户访问其授予的命名空间中的docker注册表

A project can use this user to access the docker registry only within its granted Namespace

推荐答案

此要点应提供足够的详细信息以使您滚动:

This gist should provide enough detail to get you rolling:

https://gist.github.com/nblair/1a0e05713c3edb7e5360c2b0222c7623

希望这会有所帮助!

这篇关于通过脚本创建Content Selector和Privileges,以将Docker注册表分为项目拥有的名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆