2

The lowest boundary of a Docker image can be very small i.e. under 1 MB (busybox) or even zero bytes (scratch).

Now for research purporses, I need to reference the biggest Docker image on the Docker Hub.

How to find it?

  • Are you looking at specifically Docker Hub or the Docker Store also? – PrestonM Feb 14 '18 at 14:20
  • Docker store is a good reference as well – Peter Feb 14 '18 at 16:33
  • 1
    I gave this some thought and this is what I came up with: docker search won't help, because it does not list image sizes in its output, and its --filter option does not allow filtering by size. The only idea I have therefore is around actually downloading each image and check its size. You might start with microsoft/ images to start off with as they are quite huge usually :) (not sure if this is an answer so added it as a comment) – Vish Feb 16 '18 at 12:50
  • Looking through docker search and docker hub, I am not seeing a way to find this information. I am thinking that you will need to write a script to download all of the docker images and check the size. Hopefully they aren't updated and increase in size by the time it finishes ;) – PrestonM Feb 19 '18 at 22:47
5

If you're looking for a master list of all images and sizes, kind of a 'statistics' pages, Docker Hub doesn't have that. You'll need to use their HTTP API to:

  1. get all the repositories, stepping through the paginated results. API reference: https://docs.docker.com/registry/spec/api/#listing-repositories
  2. pull the Image Manifest for each repo. API reference: https://docs.docker.com/registry/spec/api/#pulling-an-image-manifest
  3. Store those manifests in local database so you can sort them based on image size

You'll specifically need to pull the newest Image Manifest Version 2, Schema 2, which apparently not all repos support yet. This newer manifest has the image sizes in it: https://docs.docker.com/registry/spec/manifest-v2-2/

All in all, this is much faster than trying to actually download all the images from Docker Hub, but it will still take quite a long time and a lot of processing. The database for storing this all might get rather large and difficult to process, so I'm not sure how much you really want to pursue this route for a simple research project. That's up to you.

You may want to take @Vish's advice and simply go for obvious large images such as the Microsoft or Java ones.

  • 1
    I'm not convinced you even need a database. Why not just store the current biggest image and, as you work through the list, replace it with anything bigger that you find? If you care about the 10 largest, say, you can still do that -- just keep a running tally of the 10 largest. Plus, it seems pretty parallelizable. One thread pulls the pages of the list, a few more pull and process the manifests, one more works through each processed manifest and compares them to the top N. It'd still take a while, of course, but not that long, and aside from heavy network usage, not many resources. – Nic Hartley Jun 13 at 22:59
  • @NicHartley That's a really nice approach! – BoomShadow Jun 14 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.