Retrieve a list of all container's images registered in Container Engine Registry - docker-registry

I'm trying to retrieve a list of all container's images registered in Container Engine Registry. The command that should do the job "gcloud docker images" brings me only local images. In spite of this "gcloud docker pull gcr.io/myproject/myname:tag" works as expected.
Also, I have used a search API but it retrieves me names of images without their tags:
gcloud docker search gcr.io/[myproject]
Has somebody an experience with it?
Installed stuff:
Google Cloud SDK 99.0.0
alpha 2016.01.12
beta 2016.01.12
bq 2.0.18
bq-nix 2.0.18
core 2016.02.26
core-nix 2016.02.05
gcd-emulator v1beta3-1.0.0
gcloud
gsutil 4.17
gsutil-nix 4.15
kubectl
kubectl-linux-x86_64 1.1.7

You can use following command to get list of all the repositories in your GCP project
gcloud container images list --repository=HOST/PROJECT-ID
Here HOST would be gcr.io / us.gcr.io / eu.gcr.io etc based on your repo location
If you want to get list of all the versions of images in specific repository you can use list-tags command.
gcloud container images list-tags HOST/project-id/REPONAME

Related

How do you list available Docker images for a specific architecture

Trying to pull Docker images to a s390x architecture (available as Hyperprotect VS on IBM public Cloud) and the web based dockerhub search interface doesn't really have a way to only list the specific tags where a Docker image exists for a particular architecture.
I tried using docker pull, docker search, docker manifest, along with some of the "experimental" features. If a Docker image exists, the command will pull it (for example docker pull node:8.11.2) but what if I wanted to see what Node images actually were in dockerhub (or any other repository for that matter) for the s390x, arm, ppcle64, architectures?
Ideas anyone?
$ docker search node
docker pull node:8.11.2-alpine
8.11.2-alpine: Pulling from library/node
no matching manifest for unknown in the manifest list entries
I am posting the answer from this question:
For the latest (as of 2015-07-31) version of Registry V2, you can get
this image
from DockerHub:
docker pull distribution/registry:master
List all repositories (effectively images):
curl -X GET https://myregistry:5000/v2/_catalog
> {"repositories":["redis","ubuntu"]}
List all tags for a repository:
curl -X GET https://myregistry:5000/v2/ubuntu/tags/list
> {"name":"ubuntu","tags":["14.04"]}

Can I query an OpenShift Docker repository whether a given image _exists_ without pulling it?

I have a situation where I need to wait for an image to show up on a given docker registry (this is an OpenShift external registry) before continuing my script with additional oc-commands.
Before that happens, the external docker registry has no knowledge what so ever of this image. Afterwards it is available as :latest.
Can this be done programatically? (Preferably without trying to download the image)
My order of preference:
oc command
docker command
A REST api (using oc or docker credentials)
assuming the repository from openshift works similarly to dockerhub, you can do this:
curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
source

How do I list images (tags) in a remote Google Cloud docker repo?

I call this command to send my image to a repo.
docker push gcr.io/my-project/my-images:v1
It succeeds, as in fact I can apply a "Deployment" yaml and my new service is available at GKE.
My question: How do I list the images (tags) at that gcr.io repo address, to confirm that mine is there?
docker image list gives me the local list, but not the remote list.
gcloud --project=my-project container images list gives an empty result. (Yet, as stated, my image is out there.)
How can I get this list?
Use --repository flag
--repository=REPOSITORY
The name of the repository. Format: *.gcr.io/repository. Defaults to
gcr.io/<project>, for the active project.
This example will return all the available images:
gcloud container images list --repository=gcr.io/your-project
NAME
gcr.io/your-project/your-image
gcr.io/your-project/another-image
gcr.io/your-project/one-more-image
If you want to list all the tags for the specified image, run
gcloud container images list-tags gcr.io/your-project/your-image
DIGEST TAGS TIMESTAMP
0109315b26cf 5a9ad92 2018-11-15T13:24:56
98e2d1475275 343fca4 2018-11-15T11:35:52
df58b7269b89 d96aa6c 2018-11-14T17:11:18
47e93cb3a33f 7a9ff9d 2018-11-13T16:27:06
Replace my-project and my-image as appropriate and execute:
curl -sL https://gcr.io/v2/my-project/my-image/tags/list
With some jq command piping you can then get only what you need, if this is part of some automation.
Reference: Docker Registry HTTP API V2
I got "v1 Registry API is disabled" error in my tests trying the HTTP API v1 against gcr.io.

How to list container image versions in the Google private Container Registry

I can use gcloud docker search gcr.io/my-project to list the images published in my-project in the Google private Container Registry.
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
my-project/gabipetrovay-service 0
my-project/jillix-service 0
my-project/service 0
How can I see the versions available for these images?
gcloud docker inspect gcr.io/my-project/gabipetrovay-service will describe only the images that have been pulled. What I want is to see what versions a certain image has published in the Container Registry.
Docker doesn't really expose a good way to do this via the CLI.
You can hit the API directly:
curl -u _token:$(gcloud auth print-access-token) \
https://gcr.io/v2/my-project/jillix-service/tags/list
We (GCR) have some proprietary extensions, but tags: [...] is a standard part of the message, which is (I believe) what you are looking for.

Unable to see images built through docker remote api's in docker cli result

Docker remote api v1.6.:
I am using it to POST and build dockerfile. I can see my newly built images in the json image list output by same remote api, http://docs.docker.io/en/latest/api/docker_remote_api_v1.6/#id20 . During build i'm also tagging it with repository name, http://docs.docker.io/en/latest/api/docker_remote_api_v1.6/#id30.
To push this so generated image on the registry am using docker cli. But the reply from docker cli says
"No such id...".
Since am using docker cli to pull images as well i can't pull it as well.
Please help solving this sync issue in reflecting changes make through docker remote api's into docker cli result?

Resources