We have Nexus 3 OSS RM deployed with hosted docker repo called my_company_hosted. All our services’ images are in different directories i.e. a1/tags/a1-0.0.1 a2/tags/a2-0.0.1-10004 a3/tags/0.0.1-10001 etc. Is there a way to get the latest docker image tags all a1, a2, a3 etc services via API call?
When I try this call:
curl -X GET -H “Content-Type: application/json”
-u ‘user1:user1pass’
“https://nexus.mycompany,com/service/rest/v1/search?repository=my_company_hosted&name=a1”
I get:
{
“items” : [ ],
“continuationToken” : null
}
Sorted this out. Thanks everyone!
This is how I get tags of a given image, if it can help you
[11:28:04|jfgratton@bergen:certificates]: cat /opt/sbin/dockergettags.sh
#!/usr/bin/env bash
curl -sX GET https://nexus:9820/v2/$1/tags/list | jq
- nexus:9820 being my NXRM3 repo
- $1 is the image name
- also, as you can see, I pipe the output to jq, to “prettify” the json output.
–JFG