How do you manipulate tags in docker registry 2.0 and v2 API?

Now that the V1 docker registry is out of date, we launched a private v2 repo without much attention. The problem was that we used a number of v1 APIs to manage tags for deployment.

Currently, we can easily list the tags:

> curl https://repo-dns:5000/username/reponame/tags/list 

But removing the tag seems to contain more than the tag, and it seems to fail:

 > curl -X DELETE https://repo-dns:5000/v2/username/reponame/manifests/tagtodelete {"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]} 

It is also unclear how to add a new tag - it used something like:

 > echo my_image_id |curl -X PUT https://repo-dns:5000/v1/repositories/username/reponame/tags/newtag 

I looked at the API docs , but its not clear how to do this.

Is it possible to add ADD and REMOVE tags forward, and if so, how?

+6
source share
2 answers

He hasn't implemented tag removal yet - as far as I can tell from this issue: https://github.com/docker/distribution/issues/422

0
source

To add a tag: see this answer to a similar question

0
source

Source: https://habr.com/ru/post/989845/


All Articles