Where do Docker images come from, and how does a short name like alpine:latest resolve to a registry?
From a registry, by default Docker Hub: alpine:latest is short for docker.io/library/alpine:latest.
A registry is a server that stores and distributes images, organised into repositories with tags (versions). Docker Hub (hub.docker.com) is the default public registry; others include GitHub Container Registry (ghcr.io), Quay and private, self-hosted registries.
An image reference has the form [registry/][namespace/]repository[:tag]. Whatever is left out gets a default:
| Part | Default | In alpine:latest |
|---|---|---|
| Registry | docker.io (Docker Hub) |
docker.io |
| Namespace | library (the curated "official images") |
library |
| Tag | latest |
latest (given) |
So when docker image build meets FROM alpine:latest and the image is not cached locally, the build output shows it being pulled from docker.io/library/alpine:latest. A name like myregistry.example.com:5000/team/app:1.2 points somewhere else entirely.
latest is just a tag name, not a guarantee of anything. It is whatever the publisher last tagged that way, so pin a concrete tag (or a digest) when reproducibility matters.
Go deeper:
Docker Docs: What is a registry? — registries, repositories and tags, with a hands-on push and pull.
Docker Docs: Docker Official Images — what the curated
librarynamespace is and why it is trusted.