Find the Latest Docker Hub Image
pin at version, or pull latest.
Docker provides a rest endpoint to pull the all the tags for a project.
The endpoint is https://hub.docker.com/v2/repostitories/${DOCKER_HUB_REPO}/${DOCKER_HUB_IMAGE}/tags/. DOCKER_HUB_REPO is the name of a repository in Dockerhub, for example, Prometheus's repo is 'prom'. DOCKER_HUB_IMAGE is the name of the Docker image (container) you want to pull. For Prometheus, its 'prometheus'.
$ curl -s -L --fail "https://hub.docker.com/v2/repositories/prom/prometheus/tags/?page_size=25" | jq '.results | .[] | .name' -r | sed 's/\(latest\|main\)//' | sort -rV
| head -n 5
Sometimes, a project updates their docker repos on every significant pull. Some projects will have a 'dev' or 'main' tag that they use to denote the most up to date build. Prometheus is one of those projects. The 'main' tag will be updated after every successful image build. Perses is also one of those projects. Unfortunately with Perses, there is no such 'dev' tag, and latest points to the latest release.
[david@example:~]$ curl -s -L --fail "https://hub.docker.com/v2/repositories/persesdev/perses/tags/?page_size=25" | jq '.results | .[] | .name' -r | head -n 6```
normally with podman we use the 'auto update label' to tell podman to check the image repo on either a manual or regular basis.
however when you are following perses' main-<build info> tag, its a little hard to stay up-to-date on a periodic basis.
main-2025-03-07-64fa9df2-distroless-debug
main-2025-03-07-caf7bd35-distroless-debug
:wq
main-2025-03-06-bb03b44d-distroless-debug
main-2025-03-06-9c873370-distroless-debug
main-2025-03-06-595173a3-distroless-debug
main-2025-03-05-e8a67a6c-distroless-debug
main-2025-03-05-86e667e0-distroless-debug
main-2025-03-05-90332828-distroless-debug
main-2025-03-05-52262161-distroless-debug
main-2025-03-04-682a13f7-distroless-debug
main-2025-03-03-d1c247b4-distroless-debug
main-2025-03-03-4d0c756f-distroless-debug
main-2025-03-03-b38cc7ba-distroless-debug
main-2025-03-03-3330d069-distroless-debug
main-2025-03-03-44ebf7f5-distroless-debug
main-2025-03-03-7156c3f5-distroless-debug
main-2025-03-03-1032a5bd-distroless-debug
sed 's/main.*/main-2025-03-07-64fa9df2-distroless-debug/' .config/containers/systemd/perses.container