- Learn Docker:Fundamentals of Docker 19.x
- Gabriel N. Schenker
- 372字
- 2025-04-04 13:21:30
Image namespaces
So far, we have been pulling various images and haven't been worrying so much about where those images originated from. Your Docker environment is configured so that, by default, all images are pulled from Docker Hub. We also only pulled so-called official images from Docker Hub, such as alpine or busybox.
Now, it is time to widen our horizon a bit and learn about how images are namespaced. The most generic way to define an image is by its fully qualified name, which looks as follows:
<registry URL>/<User or Org>/<name>:<tag>
Let's look at this in a bit more detail:
- <registry URL>: This is the URL to the registry from which we want to pull the image. By default, this is docker.io. More generally, this could be https://registry.acme.com.
Other than Docker Hub, there are quite a few public registries out there that you could pull images from. The following is a list of some of them, in no particular order:
-
- Google, at https://cloud.google.com/container-registry
- Amazon AWS Amazon Elastic Container Registry (ECR), at https://aws.amazon.com/ecr/
- Microsoft Azure, at https://azure.microsoft.com/en-us/services/container-registry/
- Red Hat, at https://access.redhat.com/containers/
- Artifactory, at https://jfrog.com/integration/artifactory-docker-registry/
- <User or Org>: This is the private Docker ID of either an individual or an organization defined on Docker Hub—or any other registry, for that matter—such as microsoft or oracle.
- <name>: This is the name of the image, which is often also called a repository.
- <tag>: This is the tag of the image.
Let's look at an example, as follows:
https://registry.acme.com/engineering/web-app:1.0
Here, we have an image, web-app, that is tagged with version 1.0 and belongs to the engineering organization on the private registry at https://registry.acme.com.
Now, there are some special conventions:
- If we omit the registry URL, then Docker Hub is automatically taken.
- If we omit the tag, then latest is taken.
- If it is an official image on Docker Hub, then no user or organization namespace is needed.
Now that we know how the fully qualified name of a Docker image is defined and what its parts are, let's talk about some special images we can find on Docker Hub.