A published release lives in the registry. A server runs it only after it has a local copy.
registry.pier.internal this host
pier/status-page local image store containers
1.0.0 → sha256:c6ce… ──pull──► :1.0.0 2d0d3acda232 ──► status (1.0.0)
1.1.0 → sha256:e384… ──pull──► :1.1.0 ff27dcd05d6dPull by tag
docker pull registry.pier.internal/pier/status-page:1.1.01.1.0: Pulling from pier/status-page
5bb2efc62d16: Already exists
...
397116b7bd8b: Pull complete
Digest: sha256:e3848b9ad1d98e9c35ca18e84302b8c38fb30ff56a5ccd7569a02ba8bed4a352
Status: Downloaded newer image for registry.pier.internal/pier/status-page:1.1.0
registry.pier.internal/pier/status-page:1.1.0| Line | Meaning |
|---|---|
Already exists | Layer shared with an image you already have; not downloaded |
Pull complete | Layer downloaded |
Digest: | The manifest digest the tag points at right now |
Downloaded newer image / Image is up to date | Whether the local tag changed |
Pulling without a tag asks for latest. If the repository has no latest tag, the pull fails with manifest unknown.
Pull by digest
docker pull registry.pier.internal/pier/status-page@sha256:e3848b9ad1d98e9c35ca18e84302b8c38fb30ff56a5ccd7569a02ba8bed4a352This always returns the same image, even if someone re-pushes the 1.1.0 tag.
When docker run pulls
| Local copy of the name | docker run IMAGE |
|---|---|
| None | Prints Unable to find image ... locally, pulls, then starts |
| Exists | Starts the local copy, without asking the registry |
Exists, with --pull always | Pulls first, then starts |
A host that pulled latest last month keeps running last month's image. Pull explicitly, or deploy a version tag or digest.
Swap a running container
A container's image cannot be changed. Replace the container:
docker pull registry.pier.internal/pier/status-page:1.1.0
docker rm -f status
docker run -d --name status -p 8080:3000 registry.pier.internal/pier/status-page:1.1.0
curl -s localhost:8080/health{"status":"ok","version":"1.1.0"}Pull before removing the old container. If the pull fails, the old version is still serving.
Local images are a cache
docker rmi deletes the local copy only. The registry is the source of truth:
docker rmi registry.pier.internal/pier/status-page:1.0.0
docker pull registry.pier.internal/pier/status-page:1.0.0docker rmi refuses while a container still uses the image:
Error response from daemon: conflict: unable to remove repository reference "registry.pier.internal/pier/status-page:1.0.0" (must force) - container e1dd94dc29ef is using its referenced image 2d0d3acda232Remove the container first.