Nexus is repository manager. To install it basically copy the .war file to tomcat / any web host, then do some configuration.
It can be used for hosting your own docker repository, and many other repositories.
It opens two ports, by default 8082 and 8083, one for pull, another for push.
Below is about how to use it for docker images.
1. create a private Nexus repository store. Other types are 'proxy repo' and 'group repo'
select 'docker-private' as Blob store
2. Configure docker daemon.json to point to the private repo
On RHEL, edit the /etc/docker/daemon.json (create one if not exists)
add the following
{
"insecure-registries": [
"your-repo:8082",
"your-repo:8083"
]
}
3. restart the docker daemon
$sudo systemctl restart docker
4. Login into the docker repo. Pull and push need separate login. If pull support anonymous then no need to login for pull.
$docker login -u user -p password your-repo:8082
$docker login -u user -p password your-repo:8083
5. to pull images from the repo
$docker pull your-repo:8082/imagename:label
6. to push images to the repo. the your-repo can be your-repo:8083/suburl/ with sub urls.
$docker tag imagename:label your-repo:8083/imagename:label
$docker push your-repo:8083/imagename:label