Get List of Official Docker Images - docker

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?

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.
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]

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

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

Related

How to get to Docker Hub for an image from command line?

I used the following command: docker pull balenalib/beaglebone-black:latest
I am now trying to find the page for this image on Docker Hub. I search balenalib/beaglebone-black:latest and thousands of results come up, but seemingly not the one I typed in.
I finally found it here by manipulating the URL directly.
Is there a better way to do this? Can I get to that URL by using a command from terminal?
For Docker's registry's web fronted (https://hub.docker.com), there are two primary 'views':
Users|Organizations:
e.g. https://hub.docker.com/u/balenalib
NB "hub.docker.com/u/"
Users'|Organizations' Images
e.g. https://hub.docker.com/r/balenalib/beaglebone-black
NB "hub.docker.com/r/"
In the case of Docker's registry, the docker pull includes an implicit|optional docker.io/ prefix as it defaults to Docker's registry but there are other registries:
docker pull docker.io/balenalib/beaglebone-black:latest
So there's a form docker pull [registry]/[user]/[image]:[tag]
And, if you're using Linux and Chrome, you could browse to it on DockerHub using:
USER=balenalib # for example
IMAGE=beaglebone-black # for example
google-chrome https://hub.docker.com/r/${USER}/${IMAGE}
NB I find this a confusing use of similar terms, but a registry (such as Docker's) includes many repositories. In your example, using the Docker registry, balenalib/beaglebone-black is one repository in it.

Google Cloud Container Registry List images in subdirectory with gcloud command

How can I get a list of images in a "subdirectories" in a Google Cloud Container Registry?
I have those images on GCP:
gcr.io/project-id/website/api
gcr.io/project-id/website/api-builder
gcr.io/project-id/website/frontend
gcr.io/project-id/website/frontend-builder
But when I issue the command...
gcloud container images list
It only gives me
NAME
gcr.io/project-id/website
I would like to be able to get all images for a search query like project-id/website and get all 4 images above.
If I issue this command:
gcloud container images list-tags gcr.io/project-id/website
I get no results of course.
I searched Google and checked the help pages to no avail.
Thank you!
Answering my own question. I went back to GCP and saw this in the user interface:
So it clicked when I saw the "Repositories" title. Images are in repositories and can be nested.
So I tried this command:
gcloud container images list --repository gcr.io/project-id/website
And got back
NAME
gcr.io/project-id/website/api
gcr.io/project-id/website/api-builder
gcr.io/project-id/website/frontend
gcr.io/project-id/website/frontend-builder

Programmatically get docker manifest

I’m using the aws-sdk for nodejs for pushing a docker image to the aws ecr using this call:
https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutImage.html#API_PutImage_RequestSyntax
In code the sdk asks for the docker manifest which I don’t understand. I don’t have a way to get the manifest through dockerode (the npm package I use for talking to the docker api) and the ‘docker manifest’ cli command seems to be epirimental. How do I get the manifest, which is a json document described here:
https://docs.docker.com/registry/spec/manifest-v2-1/
I might be on the wrong track. It says in the documentation:
This operation is used by the Amazon ECR proxy, and it is not intended
for general use by customers for pulling and pushing images. In most
cases, you should use the docker CLI to pull, tag, and push images.
So I may not be able to use this as I intended

Bash command to list all docker images in a remote registry

I have a program setup to remotely manage images & containers on various PCs on a local network. I'd like to be able to get a list of all images available on a registry as well. I have the IP of the registry machine and am looking for some command to list everything in that registry so I could sort by repository/tag.
Thanks for any help.
I suppose that you use latest v2 docker registry.
Docker Registry v2 has a well defined REST API .
For example, if you have a registry at location: registry.example.com:5000 and https proxy, you could use address: https://registry.example.com:5000/v2/_catalog to list all repositories.
Here is an example of listing first 100 repositories and its tags in registry. Note that pagination of repositories and tags needs to be done more carefully than in this quick example.
registry="registry.example.com:5000"
repos=`curl https://$registry/v2/_catalog?n=100 | jq '.repositories[]' | tr -d '"'`
for repo in $repos; do
curl https://$registry/v2/$repo/tags/list;
done
While not a direct answer to find a list of images, you can list a specific image details with docker manifest inspect This was helpful for me finding if the image already existed or not. https://docs.docker.com/engine/reference/commandline/manifest_inspect/
Hopefully this helps someone. :)

What's the default url that docker using when run `docker pull`?

I've searched a lot but still can't get the accurate answer of this question:
What's the default url that docker using when run docker pull? (Especially the /v2 one)
I've see several urls from log or some documents:
http://index.docker.io
http://registry.hub.docker.com
http://registry-1.docker.io
But I'm not sure which one is correct, and what's the purpose of the others
Those 3 urls are there for different purposes:
http://registry.hub.docker.com is the Docker web site for listing the image.
It is not where those images are actually stored.
As the Nexus Docker settings details:
https://registry-1.docker.io is a remote storage: this issue illustrates what is going on when the storage does not answer:
This is a service issue, not related to the docker engine project.
Amazon S3 is experiencing some problems.
https://index.docker.io/ is the docker index, used for requests related to searches, users, docker tokens and other aspects.
To quote man docker-pull:
If you do not specify a REGISTRY_HOST, the command uses Docker's public registry located at registry-1.docker.io by default.
I don't think you can get more official than that.

Resources