version 2.1
Setup a local private Docker registry with basic auth for testing.
Deploy the registry using docker, the restart
flag will allow the registry to always run when the Docker Engine starts up on port 5000.
docker run -p 5000:5000 --restart always --name registry brittanym/registry:2.1
When running this registry as is, it is insecure and uses self-signed certs.
Follow the Deploy a plain HTTP registry section to add the insecure registry to the Docker host and follow the next section Use self-signed certificates to add the custom certificate so that the Docker daemon will trust the registry.
The authorization file was created using htpasswd. Use docker login
to authenticate with the registry, username admin
and password admin123
.
Login:
docker login localhost:5000 -u admin
The default password can be modified by overwriting the htpasswd file at /auth/.htpasswd
:
htpasswd -Bbn admin [new_password] > /auth/.htpasswd
To manually add another user using htpasswd use the previous command with a few modifications:
- replace
>
with>>
- replace the username
admin
with the new username
To build an image with unique or secure specifications, use the Dockerfile provided in this repo. A docker image is available to pull directly from Docker Hub.
The defaults of this project are not secure and should not be deployed directly into a production environment.