badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
23.92k stars 5.51k forks source link

Badge request: Newest dockerhub image #6016

Open yspreen opened 3 years ago

yspreen commented 3 years ago

:clipboard: Description

This badge would work similarly to the docker version badge. Instead of showing the latest tag by date, it would show the latest date of the newest tag. This shows that a docker image is up to date.

:link: Data

The docker version badge already makes use of the date of images. I was thinking about creating a PR myself, but the docker version service looked a bit intimidating so far. As far as I can tell, the same API should also provide the newest date.

:microphone: Motivation

Docker hub builds images according to GitHub sources. But there's no way of knowing if a Docker image is actually maintained by looking at the git repo. It should be possible to see at a glance: How old is this image? Is the underlying ubuntu/alpine/debian up to date or is it ancient? Does it make sense to build the image on my own, or can I use this one and trust that it has recent software in it?

You don't have to push code to a git repo to build an image on Docker Hub. In fact, I don't change my repos much but I trigger rebuilds all the time. Someone who looks at a git repo without a commit in 2y might think that its image is outdated but it might be really new.

chris48s commented 3 years ago

dockerhub api has a last_updated property on the image object so this should be fairly straightforward (accepting that dockerhub is one of the more slightly complicated services).

yspreen commented 3 years ago

Are you suggesting I'd try and give a PR a shot?

chris48s commented 3 years ago

I was confirming its a sensible feature request (sometimes people suggest badges we couldn't implement e.g: because there's nowhere we can get the data) and ready to work on. If you want to submit a PR that would be great.. or someone else can work on it if they want.

If you're interested but finding the dockerhub code a bit daunting, here's a few quick pointers

the-maux commented 2 months ago

ok