The Registry is deployed as a container and accessible via port 5000. Docker clients will use this domain to access the registry and push/pull images. By specifying a domain, a client can access multiple registries.
In this example our Docker registry is located at registry.test.training.katacoda.com.
docker run -d -p 5000:5000 \ -v /root/certs:/certs \ -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/registry.test.training.katacoda.com.crt \ -e REGISTRY_HTTP_TLS_KEY=/certs/registry.test.training.katacoda.com.key \ -v /opt/registry/data:/var/lib/registry \ --name registry registry:2
Mounting the volume /var/lib/registry is important. This is where the Registry will store all of the pushed images. Mounting the directory will allow you to restart and upgrade the container in future.