How do I query all images in local docker repository?

To get the list of all of the images which are stored on your local docker repository in Artifactory, 

you can use AQL with a property criteria (See here about properties in general).


This is the AQL query:

items.find(

{

“repo”:{“$eq”:”<docker repository name>”},

“@docker.repoName” : { “$eq” : “*” }

}

).include(“name”, “@docker.repoName”, “@docker.manifest” ,”stat.downloads”)


Whereas the property ‘docker.repoName’ is the same name used to tag the image before it was pushed to the repository and the ‘docker.manifest’ is the image’s version.


Running the REST api call:

curl -u <user> -i -X POST http://localhost:8081/artifactory/api/search/aql -H “content-type: application/json” -T dockerImagesExample.json


Will provide the following output:


“results” : [


{

“name” : “manifest.json”,

“properties” : [ {

“key” : “docker.manifest”,

“value” : “latest”

}, {

“key” : “docker.repoName”,

“value” : “mysql”

} ],

“stats” : [ {

“downloads” : 0

} ]

} ….