Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker registry 2.0 API v2

Tags:

I pulled and setup the local docker registry:2.0

I have tried pushing an image successfully, but when ever I try searching for an image I get 404:

root@ip-10-232-0-153:~# curl -v -X GET http://localhost:5000/v2/search * Hostname was NOT found in DNS cache *   Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 5000 (#0) > GET /v2/search HTTP/1.1 > User-Agent: curl/7.35.0 > Host: localhost:5000 > Accept: */* > < HTTP/1.1 404 Not Found < Content-Type: text/plain; charset=utf-8 < Docker-Distribution-Api-Version: registry/2.0 < Date: Fri, 08 May 2015 00:00:45 GMT < Content-Length: 19 < 404 page not found * Connection #0 to host localhost left intact 

Also when I try to curl localhost:5000, I just get a 404:

404 page not found 
like image 766
alexfvolk Avatar asked May 08 '15 00:05

alexfvolk


People also ask

What is Docker registry API?

The Docker Registry HTTP API is the protocol to facilitate distribution of images to the docker engine. It interacts with instances of the docker registry, which is a service to manage information about docker images and enable their distribution.

What are the two types of registries in Docker?

There are 2 types of container registries: public and private.

What is the default registry for Docker?

Docker Hub is Docker's official cloud-based registry for Docker images. As you might expect, since Docker Hub is Docker's official registry, it is the default registry when you install Docker.

Do I need a Docker registry?

Developers also use these registries to secure their Docker images. If you want to avoid uncovering issues after it is too late, use a Docker registry that can identify issues as soon as they occur. Finally, developers use registries for Docker images to deploy their containers reliably.


1 Answers

UPDATE (14 April 2016): Still not here in the distribution roadmap, but here is a particular issue about search.

UPDATE (12 November 2015): The API endpoints still do not yet exist and are not yet in the Docker Registry roadmap.

The problem here is that the new v2 Docker registry doesn't support that particular endpoint yet, as of this question and answer. You can check the source itself for the route endpoints, and you'll see that most of the API endpoints involve simple operations like uploading and tagging, but no implementation yet of the search endpoint. It's important here to note that the v2 registry is a completely different project than the v1 registry. It's even written in a completely different language (v1 was a Python project, whereas v2 uses Go, which is more in line with the rest of the Docker projects). It took me some time and serious reading to understand the dichotomy here between the registries. It is worth looking at this particular Github issue about the v2 registry for a deep-dive into a recent discussion on the state of the v2 registry, as well as some discussion about where they've been taking it.

So there's no search endpoint in the v2 registry yet. You can list your image by tag or by the image name itself as mentioned in task number 8 in this documentation.

like image 176
L0j1k Avatar answered Sep 21 '22 15:09

L0j1k