Create Content Selector and Privileges via script for separating a docker registry into project owned namespaces

最后都变了- 提交于 2020-01-01 19:31:31

问题


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 :-)

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 Create Content Selector format == "docker" && (path == "/v2/" || path =^ "/v2/PROJECTNAME/")

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

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

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

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


回答1:


This gist should provide enough detail to get you rolling:

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

Hope this helps!



来源:https://stackoverflow.com/questions/43094125/create-content-selector-and-privileges-via-script-for-separating-a-docker-regist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!