Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to specify registry in query string for image/create api endpoint #15085

Open
bronislav opened this issue Jul 28, 2015 · 1 comment
Open

Comments

@bronislav
Copy link

Docs for API v1.19 states that it is possible to specify registry query parameter:

Query Parameters:
    ...
    registry – The registry to pull from.
    ...

I'm trying to do so, but it's ignores registry parameter:

$ curl -v -XPOST --unix-socket /var/run/docker.sock "http:/images/create?fromImage=bronislav/clsi-sharelatex:latest&registry=quay.io"
*   Trying /var/run/docker.sock...
* Connected to http (/var/run/docker.sock) port 80 (#0)
> POST /images/create?fromImage=bronislav/clsi-sharelatex:latest&registry=quay.io HTTP/1.1
> Host: http
> User-Agent: curl/7.42.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Tue, 28 Jul 2015 14:22:51 GMT
< Transfer-Encoding: chunked
<
{"status":"Pulling repository bronislav/clsi-sharelatex"}
{"errorDetail":{"message":"Error: image bronislav/clsi-sharelatex:latest not found"},"error":"Error: image bronislav/clsi-sharelatex:latest not found"}
* Connection #0 to host http left intact

If I move registry parameter to the image path than docker started to pull image:

curl -v -XPOST --unix-socket /var/run/docker.sock "http:/images/create?fromImage=quay.io/bronislav/clsi-sharelatex:latest"
*   Trying /var/run/docker.sock...
* Connected to http (/var/run/docker.sock) port 80 (#0)
> POST /images/create?fromImage=quay.io/bronislav/clsi-sharelatex:latest HTTP/1.1
> Host: http
> User-Agent: curl/7.42.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Tue, 28 Jul 2015 14:48:16 GMT
< Transfer-Encoding: chunked
<
{"status":"Pulling repository quay.io/bronislav/clsi-sharelatex"}
...
{"status":"Status: Image is up to date for quay.io/bronislav/clsi-sharelatex:latest"}
* Connection #0 to host http left intact

My environment:

$ docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d-dirty
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d-dirty
OS/Arch (server): linux/amd64
$ docker info
Containers: 2
Images: 27
Storage Driver: overlay
 Backing Filesystem: extfs
Execution Driver: native-0.2
Logging Driver: journald
Kernel Version: 4.0.9-coreos
Operating System: CoreOS 752.1.0
CPUs: 2
Total Memory: 7.341 GiB
Name: ip-10-5-3-181.empire
ID: 7APU:UBUI:7WEM:X5DL:BY7B:MQM6:4IAX:VZUN:2GZ4:LV7I:7PWI:42UC
$ uname -a
Linux ip-10-5-3-181.empire 4.0.9-coreos #2 SMP Thu Jul 23 20:22:11 UTC 2015 x86_64 Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz GenuineIntel GNU/Linux

Further investigation shows that this parameter simply ignored in the request handler. It's only takes in account fromImage, repo and tag parameters: api/server/server.go#L729-L733.

@stevvooe
Copy link
Contributor

In general, I would say the registry parameter is a bit of an outlier. This is a good data model, but doesn't match the rest of the image resolution magic.

From what I can tell, #15093 looks like the correct fix. I'll take a close peak at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants