Skip to content

Remote & Local Registry

A registry is a central repository where Docker images are stored and managed.

If containers are the “rain,” the registry is the “cloud” they fall from.

Docker images follow a specific naming structure: registry-url/user-or-org/repository:tag.

  • Official Images: When you run docker run nginx, Docker assumes the full name is docker.io/library/nginx:latest. The library prefix denotes an official Docker Hub image.
  • User/Org Images: If you create an image, it follows the pattern username/image-name (e.g., pavan/my-app).
  • Default Registry: If no URL is specified, Docker defaults to Docker Hub (docker.io).

image.png

  • Public Registries: Accessible to everyone. Examples include Docker Hub and Google’s GCR.io (often used for Kubernetes images).
  • Private Registries: Used for in-house applications that should not be public. Cloud providers like AWS (ECR), Azure (ACR), and GCP (GCR/Artifact Registry) provide these.
  • Authentication: To use a private registry, you must authenticate before pulling or pushing.
    • Command: docker login <registry-url>
    • Note: If you aren’t logged in, Docker will return an “image not found” error for private repos.

image.png

If you are on-premises and need a local registry, you can run the official registry image as a container.

  • Start Registry: docker run -d -p 5000:5000 --name local-registry registry
  • How it works: The registry application exposes an API on port 5000.

image.png

To push an image to a non-default registry, you must “tag” it with the registry’s address.

Step 1: Tag the image

Terminal window
pavan_bandaru@epam~> docker image tag my-image localhost:5000/my-image

Step 2: Push to the local registry

Terminal window
pavan_bandaru@epam~> docker push localhost:5000/my-image

Step 3: Pull from the network From another host in the same network, you would use the IP of the registry host:

Terminal window
pavan_bandaru@epam~> docker pull 192.168.1.10:5000/my-image