Setting up Public repository - Sonatype Nexus Repository - Sonatype Community

Setting up Public repository

post by mohamedsultan.ms304 on Jun 7, 2021

Hi. I’m new to Nexus. Glad to be a part of community.

I have an use case where i need to make the particular repository public and it shouldn’t be asking for any auth when docker pull. Please help me out.

Nexus - OSS 3.29.2-02

Thanks! 😃

post by mmartz on Jun 7, 2021

Basically, you need to add permissions to access that repository to the assigned anonymous user (by default it’s the anonymous user, with the nx-anonymous role).

post by mohamedsultan.ms304 on Jun 7, 2021

Thanks for replying. Can you please bit more explain the steps need to be followed?

post by mmartz on Jun 7, 2021

I’d suggest looking at the documentation for Access Control

post by mohamedsultan.ms304 on Jun 7, 2021

Thanks for sharing.

Here is what i have tried.

  1. Created a role with,
    • privileges - nx-repository-admin-* and nx-repository-view-* (i.e selected all privileges of the repository)
    • role - nx-anonymous
  2. I have attached the role to the anonymous user

I couldn’t able to pull the image in local without docker login the artifactory

I’m getting “no basic auth credentials” again

Please help me out if i did something wrong

post by rseddon on Jun 7, 2021

Do not grant nx-repository-admin access, that allows UI administration of the repository. Grant the “read” and “browse” nx-repository-view privileges for the repository to the “anonymous” user.

Enable the docker bearer token realm under “security → realms”, and also enable anonymous pull support in the repo itself:

https://help.sonatype.com/display/NXRM3/Docker+Authentication#DockerAuthentication-UnauthenticatedAccesstoDockerRepositories

Rich

post by mohamedsultan.ms304 on Jun 7, 2021

Thanks Rich.

I did modifications as you mentioned.

Created a new role with nx-repository--read and nx-repository--browse

Attached to the anonymous user.

But I couldn’t able to pull image without auth. I’m not sure where i’m doing wrong 😞

post by mpiggott on Jun 7, 2021

I believe the docker repository also has an anonymous pull option.

post by mohamedsultan.ms304 on Jun 7, 2021

Yes. it has been enabled in settings