Naming to docker.io: how Docker image names resolve and how to avoid surprises
Codemia Knowledge Hub ·
A Docker image name has a registry, a repository and an optional tag. When you leave out the registry, Docker assumes docker.io (Docker Hub), and for single-word names it also assumes the library namespace. So ubuntu:latest really means docker.io/library/ubuntu:latest. Writing the full registry path avoids pulling from a registry you did not intend.
The parts of an image name
- Registry: where the image is stored.
- Repository: the name of the user's or organization's image repository.
- Tag: an optional identifier that distinguishes image versions.
In docker.io/library/ubuntu:latest, docker.io is the registry, library/ubuntu is the repository, and latest is the tag.
The implicit docker.io default
Docker's defaults hide the registry. Running docker pull ubuntu:latest fetches docker.io/library/ubuntu:latest. This implicit behavior can make names ambiguous, which is why it helps to know the default rules.
How a name is resolved
- When you run
docker pull ubuntu:latest:- Docker resolves the image from the default registry,
docker.io. - It looks in the
librarynamespace, a legacy convention.
- To use a different registry, give the full path, for example
docker pull myregistry.example.com/myrepo/ubuntu:latest.
Ambiguity between machines
Suppose two users set up their systems differently:
- User A runs
docker pull customrepo/myapp. - User B runs
docker pull myapp.
Both mean to fetch the same image, but if User A's custom repository is not mirrored for User B, they can end up with different versions or even different software.
Risks of implicit names
- Security: pulling from the wrong or an unintended repository can mean running malicious code.
- Deployment consistency: without explicit image details, environments can run different software versions without anyone noticing.
Connectivity problems and deployment delays also happen when an image is accidentally pulled from the default docker.io registry instead of an enterprise or private one.
Preventing naming problems
- Explicit naming: always specify the full registry path to avoid ambiguity.
- Pin the version: use a specific tag such as
docker.io/library/ubuntu:24.04instead oflatest, or a digest (ubuntu@sha256:<digest>) when every machine must get the exact same image. - Control where Hub pulls go: in an enterprise setup, push images to your private registry and reference them by that registry's name, or set
registry-mirrorsin/etc/docker/daemon.jsonso Docker Hub pulls go through your mirror. Mirrors apply only to Docker Hub images.
Related reading
- Need help troubleshooting a .NET Core 2.1 API in a linux Docker
- Neo4j docker-compose to kubernetes
- Network timed out while trying to connect to https//index.docker.io
- ng serve not working in Docker container
- .net implementation of bcrypt
- .NET obfuscation tools/strategy
- Nginx request for two or more nodes in Kubernetes
- No access permission error with npm global install on docker image
System design interview problems on this topic
- Design a Container Orchestration System: solution and walkthrough
- Design a Code Deployment System: solution and walkthrough
- Design GitHub Actions: solution and walkthrough
- Design a Serverless Architecture Framework: solution and walkthrough

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.