Menu

1 / 3

Which of my Docker containers are behind? A read-only check that fits in cron

DEV Community: docker·Alessio·9 days ago
#aPbkFsLz
#devtodocker#devto#dev#docker#digest
Long article (541 words) — no AI summary yet.
Reading 0:00
15s threshold

Pulling and restarting is easy to automate. Knowing what would change before you do it is the part I kept skipping.

On a single Docker host the question is simple: which of my running containers are on an image that is no longer the newest one? docker ps won't tell you. A floating tag like :latest or :7.2-alpine can be rebuilt upstream while your container keeps running the old digest, and a pinned tag like 1.21.0 never tells you that 1.21.3 exists.

So I built a small tool for that one question. Full disclosure: I wrote it. It's called imagenudge-lite : one Python file, standard library only (3.9+), MIT.

What it does

Lists running containers through the local Docker socket, using only GET requests.

Asks the registry whether the tag each container runs now points to a different digest ( HEAD on the manifest, no layers downloaded).

Looks for a newer version tag in the same style and suffix: 1.25.1 is compared with X.Y.Z , 16-alpine with N-alpine , v2.10.4 with vX.Y.Z .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.