dockerdocker-registry.htpasswd

How to Setup multiple user with htpasswd for docker registry that each of the has only access to their personal path?


I have a docker registry that uses htpasswd for authentication. I want to have multiple users each can only pull images from a certain path. For example:

user1 can pull images only from the below path

mydomain.com/v2/user1/

user2 can pull images only from the below path

mydomain.com/v2/user2/

right now each non admin user can pull from anywhere

Is there any way that can I fix it with htpasswd if not what are the alternatives?


Solution

  • Docker Distribution does not provide such level of granularity. You can build something yourself such a put a reverse proxy in front of the registry that has the logic you need or use a more advanced solution such as Harbor or if you want it really light wight, maybe trow fits the bill as well.