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.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Pulling an Image
For example, running: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:| Component | Description | Example |
|---|---|---|
| Registry | Hostname of the registry (defaults to Docker Hub) | docker.io |
| Namespace | User or organization under which the image lives | library (for official images) |
| Repository | Name of the image project | httpd |
Implicit Namespace
When you specify onlyhttpd, Docker assumes you want the official image from Docker Hub’s library namespace.Effectively, Docker interprets:
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:
You can verify the full reference of an existing image with:
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:Always ensure you’re logged in to the correct registry. Pushing to the wrong registry can overwrite critical images.