Where are the images stored?
DockerIn the previous lesson, we saw that a container is created from an image.
But this naturally raises another question: Where are these images located?
Contrary to what you might think, images aren’t just on your computer. They’re usually stored in imageDocker registries (called registries).
DockerA registry is simply a server that stores and distributes images. It’s a bit like a warehouse where you can go to get the images you need.
TheDockerHub: the official marketplace
The best-known registry isDockerHub: hub.docker.com.
It is the official platform provided by the company behind DockerDocker.
DockerYou can think of it as the central supermarket for images. Thousands of images are available there, ready to be downloaded and used immediately.
In particular, you’ll find:
- official images maintained byDocker Docker or software publishers
- images created by the community
- custom images published by companies or developers
For example, there are ready-to-use images for:
- Apache
- Nginx
- MariaDB
- PostgreSQL
- WordPress
- Redis
This means that instead of manually installing software on a server, you can often simply download the corresponding image and launch a container.
How toDockerfind images
By default, when you use a command like:
docker pull nginx
Docker automatically fetches the image fromDockerHub.
In reality,Docker interprets the command as follows:
docker.io/library/nginx
Simplified diagram:
Votre serveur
│
│ docker pull nginx
▼
Docker Hub
│
▼
Téléchargement de l'image
Once downloaded, the image is stored locally on your machine and can be used to launch containers.
There are other registries
AlthoughDockerHub is the most popular registry, it is not the only one.
DockerMany platforms also offer image registries. This is particularly true of certain services used by developers.
For example:
- GitHub Container Registry
- GitLab Container Registry
- Google Container Registry
- Amazon Elastic Container Registry (ECR)
These registries are often used to publish your own images within a project or organization.
For example, when an application is built automatically via a CI/CD pipeline, the image can be published to a registryGitHubor GitLab so that it can then be deployed to servers.
Hosting Your Own Registry
In certain contexts, it may be beneficial to host your own image registry.
This is often the case in:
- enterprises
- internal environments
- isolated infrastructures
- projects requiring private images
There are several solutions available for setting up a private registry, such as:
- GitLab Container Registry
- Nexus Repository
- Harbor
- or the officialDockerRegistry
The benefit is being able to fully control your images, manage access, and avoid relying on an external service.
Downloading an image from another registry
When the image comes from a registry other thanDocker Hub, you must explicitly specify the repository address in the image name.
The general structure is as follows:
registre/organisation/image:tagSimplified diagram:
URL du registre
│
▼
registre/organisation/image:tag
│ │ │
│ │ └── version de l'image
│ └──────── nom de l'image
└───────────────────── registre
GitHubExample using the registry:
docker pull ghcr.io/organisation/mon-image:latest
In this example:
ghcr.iocorresponds to theGitHubContainer Registryorganisationcorresponds to the namespace or projectmon-imageis the image namelatestis the tag, i.e., the image version
latestIf no tag is specified,Docker will use by default.
This behavior is the same for all registries, whether public or private.
Be aware of request limits
For several years now,Docker Hub has enforced image download limits (rate limits). This means that the number of possible requests may be restricted depending on the type of account used.
For example, an unauthenticated user may be limited to a certain number of image downloads over a given period. Authenticated or paid accounts generally benefit from higher limits.
These limits are primarily in place to prevent abuse and conserve the platform’s resources.
⚠️ Important: These limits may change over time, so it is always best to consult Hub’sDocker official documentation to find the exact values at the time you are using the service.
In environments with many deployments (CI/CD, clusters, etc.), some organizations prefer to use:
- a registry cache
- or a private registry
to reduce the number of requests toDockerHub.