How does a Docker image differ from a container, and how do registries, tags and push/pull work?
Short answer
An image is a read-only template made of layers; a container is one run of an image, with an extra temporary writable layer and a process. A registry (Docker Hub, GHCR, ECR, Harbor) stores and shares images, like GitHub for code.
3 points to say:
- One image, many containers; editing files in a container only changes its writable layer, never the image.
- Image name =
registry/repository:tag; tags can move, the digestsha256:...is what is immutable. - Push/pull through a registry works like
git push/git pull; removing a container (docker rm) does not touch the image (docker rmi).
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.