Open styfle opened 5 years ago
I found the API ✨
https://api.microbadger.com/v1/images/node https://api.microbadger.com/v1/images/elasticsearch https://api.microbadger.com/v1/images/mhart/alpine-node
It's just super slow 🤷♂️
Indeed it's extremely slow 🤦♂️
Badgen's requests would timeout at 3 seconds (to make sure response for GitHub before it's timeout). We need to find a faster api for this, maybe official docker hub api or some other handy alternative. Or help them speed up this. A simple CDN cache would do the work.
I looked at the official docker hub api but it doesn't seem to aggregate the sum of the layers. You might be able to get each layer individually with several api calls and then perform the sum yourself.
That's basically what package phobia does for npm...but even npm isn't interested in adding this feature to their registry. So docker will likely avoid this too 😞
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Should we keep this issue open? I think the idea of image size as a badge is relevant, even if it doesn't come from microbadger service.
@styfle Sure
Seems we can get layers info from official registry api https://docs.docker.com/registry/spec/api/#pulling-an-image
While I hate to add another token 😾
Support for the docker build status similar to shield.io would be useful as well https://img.shields.io/docker/build/vuejs/ci
microbadger.com shows the size, number of layers, and version of a docker image.
It would be nice if badgen could support this service (I am not sure if an API is available).
https://images.microbadger.com/badges/image/node.svg https://images.microbadger.com/badges/image/elasticsearch:2.3.1.svg https://images.microbadger.com/badges/image/mhart/alpine-node:base-10.12.0.svg