How to use multiple auths/ logins for same docker registry

You can use the --config option of the Docker client to store multiple credentials into different paths:

docker --config ~/.project1 login registry.example.com -u <username> -p <deploy_token>
docker --config ~/.project2 login registry.example.com -u <username> -p <deploy_token> 

Then you are able to call Docker commands by selecting your credential:

docker --config ~/.project1 pull registry.example.com/project1
docker --config ~/.project2 pull registry.example.com/project2

Leave a Comment