How to get a list of official Docker images?
Asked Answered
F

3

8

I am trying to get a list of all the official images from the Docker Store. However, I could not find any simple way to get the list. Docker CLI has a docker search command but it does not have any argument to get a list of all the images from the Docker Store and then filter it later.

Any ideas how it could be done?

Flotsam answered 1/4, 2017 at 6:38 Comment(0)
W
4

If you click the "explore" menu item at the top; https://store.docker.com/search?q=&source=verified&type=image all official images are shown. You can find non official images in the "Community (Docker Hub)" section.

Docker Store explore options

From the command-line, you can search using the --filter is-official=true filter option, for example:

docker search --filter is-official=true php
NAME             DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
php              While designed for web development, the PH...   2210      [OK]
php-zendserver   Zend Server - the integrated PHP applicati...   110       [OK]
Werra answered 1/4, 2017 at 14:24 Comment(5)
Well, I am interested in command-line solution so that I can programmatically get complete list without going through docker store webpages. However, your solution require query term to be added such as 'php' in your case. I need something like a regex to get every image something like following. docker search --filter is-official=true *Flotsam
No, I don't think the current search API provided by Docker Hub and Docker Store have this. Can you explain the use case for showing all images? It occurs to me that usuall you'd be looking for some image, so search for keyword?Werra
I am doing a project where I am analyzing all the official images to find some specific packages. So I need the list of all the official images which I can docker pull in my script and later analyze them.Flotsam
I don't think the search API is really intended for scraping Docker Hub. You could script searching for a, then searching for b, etc, then remove the duplicates.Werra
I'd be interested in an API call for that, too. @Flotsam have you solved this?Wallache
M
1

you can use their api. the trick is replacing the _ from the public url with library: https://hub.docker.com/v2/repositories/library/

Mollusc answered 4/1, 2022 at 17:18 Comment(0)
G
0

In addition to the other solutions mentioned, you can list all images under the library user from the hub page (less programmatic than the hub API mentioned by kpacha):

https://hub.docker.com/u/library/

And there's also the upstream github repo:

https://github.com/docker-library/official-images/tree/master/library

Gobetween answered 5/1, 2022 at 19:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.