Registry outdated leading to old images being pulled

Trying to pull the newest image for a tag is resulting in pulling old builds.

As an example, running docker pull postgres:16-alpine according to docker hub should be a build (Docker) from about 20 hours ago at time of writing.

The actual thing that happens is an image from 5 weeks ago is pulled down and docker thinks it’s up to date.

This results in docker desktop also showing that the image is outdated, but trying to pull from that UI results in it saying it’s already up to date.

Steps to replicate:

  1. docker pull postgres:16-alpine

Note that you get an old image from what is listed on dockerhub

“Last pushed” means it was pushed at that time, not created. So Docker Hub shows when the image was pushed, not when it was built. They probably have a pipeline where they rebuild images from time to time and push it even if there was no change. If you have images on Docker Hub, you can pull one of your old images, push it without changing anything and see Docker Hub will show it was pushed a few seconds ago. Docker Desktop on the other hand shows the date from the image metadata.

You can check the release dates on the Postgres site:

https://www.postgresql.org/docs/release/16.2/

The last Postgres 16 was released on 2024-02-08. This is the same as what you can see when you inspect the image:

docker image inspect postgres:16-alpine --format '{{ .Created }}'

Output:

2024-02-08T19:52:58Z

It was based on alpine:3.19.1, which was created on 2024-01-26.

What I don’t understand either is why the postgres:16-bookworm image was created 28 days ago when its base, debian:bookworm-slim was created 8 days ago and postgres:16-bookworm was pushed 6 days ago. I guess it is not rebuilt immediately and the two days difference was not enough to trigger the event of rebuilding.

If you think it should have been already rebuilt, you can check the image description on Docker Hub and look for the link after “Where to file issues”

1 Like