August 2017
Intermediate to advanced
332 pages
9h 16m
English
Unless we use the registry inside a well-secured private network, we should configure the authentication.
The simplest way to do this is to create a user with a password using the htpasswd tool from the registry image:
$ mkdir auth$ docker run --entrypoint htpasswd registry:2 -Bbn <username> <password> > auth/passwords
The command runs the htpasswd tool to create the auth/passwords file (with one user inside). Then, we can run the registry with that one user authorized to access it:
$ docker run -d -p 5000:5000 --restart=always --name registry -v `pwd`/auth:/auth -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/passwords -v `pwd`/certs:/certs -e ...
Read now
Unlock full access