Shahar Hamuzim Rajuan
Shahar Hamuzim Rajuan

Reputation: 6129

Fetching docker images versions from artifactory

I am trying to get a list of versions for a specific docker image from Artifactory.

Same as you have a maven meta-data.xml file that you can manipulate in to lists you all the versions of a maven artifact. From referring the Artifactory documentation I didn't see any api for this kind of request.

Has anyone done that before?

Upvotes: 0

Views: 4733

Answers (1)

RGG
RGG

Reputation: 1913

You may be confusing the topics of what's considered a version for maven/gradle with a version inside of Docker. Docker images do not have a version concept, rather the concept is tags. A tag may be a version, but could also be a Git commit hash, or other meaningful identifier.

Since you already know the docker image, you should be able to use the Docker API specification which has been implemented for Artifactory.

Docker API -- Listing Image Tags

Artifactory API -- Listing Tags

You should be able to request from artifactory on the API endpoint for listing tags.

/v2/library/nginx/tags/list

Example:

curl -u username:password -X GET https://docker.artifactory.site.com/artifactory/v2/library/nginx/tags/list

Should result in the listing in all of the tags for Nginx.

{
    "name": "library/nginx",
    "tags": [
        "1",
        "1-alpine",
        "1-alpine-perl",
        "1-perl",
        "1.10",
        "1.10-alpine",
...
...

Upvotes: 2

Related Questions