Images and registries
Containers are made from images — the packaged filesystem and recipe a container starts from — and images live in registries, the libraries they are pulled from. This chapter covers the shelf (what the engine holds), the fetching (pulling, tags, and the untagged), and the keys to private shelves (registries with logins).
Check: the images page, or its API
twin in transcript
portainer-lab/transcripts/t06-images-volumes-networks.txt,
lists the lab engine's four images
with their sizes — the console's own
image among them, 156 MB, which is a
fair picture of what a console costs.
The shelf
The images list shows each image's
tags (nginx:alpine), its size, and
its creation date, and marks the ones
no container is using. Two habits
follow from reading it well:
- A tag is a nickname, not a
version.
latestmeans "whatever was newest when pulled", which is why chapter 12's update procedure pulls deliberately and chapter 6's stack pinsnginx:alpine— a moving tag, chosen for a practice stack and named as such. Serious stacks pin exact tags, or digests. - Size is shared. Images are stored in layers, and the list's sizes overlap: four images totalling more than the disk they occupy, because layers in common are kept once. The engine's disk-usage view, not the list's sum, is the truth.
Pulling, and the untagged
Pull fetches an image by name and
tag before any container needs it —
worth doing deliberately for the big
ones, so a deploy does not spend its
first minutes downloading. Images no
tag points at any more — left behind
every time a tag moves to a newer
build — appear as <none> (dangling),
and prune is the one-click broom
for them and other unreferenced
clutter. Pruning is safe in the small
(it only takes what nothing uses) and
worth reading before clicking in the
large: "not used by a running
container" and "not wanted" are
different countries, and a stopped
stack's images live near the border.
Registries
By default everything comes from Docker Hub, the public registry. Registries → Add registry teaches Portainer others:
- Public alternatives — Quay, GitHub's GHCR, a cloud vendor's registry — each with its own address.
- Private registries, including one you run, with a username and password (or token). Portainer holds the credential, offers it when a stack or pull names that registry, and can share it with the users you choose.
Treat a registry credential in Portainer with chapter 1's respect: it is a secret stored in the console's database, usable by administrators, and — where you share it — by the people you share it with. A token scoped to read this one repository is the right size of key; an account password that also opens the registry's own front door is not. Registries are described here from the documentation: the lab pulled only public images, anonymously, and criteria.md keeps that distinction.