I’ve been able to set up and secure a private registry similar to the tutorial here: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04

However, I would like to create a user that can only pull images (no pushes). How do I do it?

Thanks.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

If the username starts with admin or admin-, the subrequest handler responds with a status code of 200. This response allows any client request to proceed to the registry via the original handler (location /). A match on this condition effectively grants full read-write access to the registry.
If the username does not start with the admin prefix, but the HTTP request method is GET or HEAD, the subrequest handler responds with 200 status. This response allows the client request to proceed to the upstream registry. A match on this condition effectively grants read-only access to the registry.
In any other case, the subrequest handler responds with a 403 Forbidden. The original request handler aborts further processing and returns the 403 response to the client. A match on this condition prohibits the client request from reaching the registry. In effect, this condition prevents all anonymous user access and prevents anything but GET and HEAD access (i.e., read-only access) by non-admin users.

  • I think I need some clarification in your answer.

    I’ve set up Nginx in front of the registry to handle authentication. I created a user, (“admin” isn’t in the name at all) that has full access to push and pull images. I would like to create another user that is only able to pull images. The read-only user would still need to authenticate with a username and password.

Submit an Answer