Skip to main content
In this lesson, you’ll learn how Docker interprets image names when you pull or reference them. Understanding these conventions helps you avoid naming conflicts and ensures you’re pulling or pushing images to the correct registry.

Pulling an Image

For example, running:
docker image pull httpd
might look simple—but what does httpd actually represent, and where does Docker retrieve it from?

Docker Image Naming Components

A complete Docker image reference can include up to three parts:
ComponentDescriptionExample
RegistryHostname of the registry (defaults to Docker Hub)docker.io
NamespaceUser or organization under which the image liveslibrary (for official images)
RepositoryName of the image projecthttpd

Implicit Namespace

When you specify only httpd, Docker assumes you want the official image from Docker Hub’s library namespace.
Effectively, Docker interprets:
image: library/httpd
Here, library is the namespace for curated, official images on Docker Hub, and httpd is the repository name.

Default Registry

By default, Docker pulls from Docker Hub (docker.io). Omitting the registry is shorthand for:
image: docker.io/library/httpd
The registry is where images are stored. When you build and push an image, it goes to this registry; when you pull, it comes from here.
You can verify the full reference of an existing image with:
docker image inspect httpd --format '{{.RepoDigests}}'

Referencing Other Registries

If your image lives in a different registry—such as Google Container Registry or a private registry—you must prepend the registry hostname:
# Google Container Registry (GCR)
image: gcr.io/your-project/httpd

# Private registry
image: registry.example.com/your-namespace/httpd
Before interacting with private registries, authenticate using:
docker login <registry-hostname>
Always ensure you’re logged in to the correct registry. Pushing to the wrong registry can overwrite critical images.