docker-archive / docker-registry

This is **DEPRECATED**! Please go to https://github.com/docker/distribution
Apache License 2.0
2.88k stars 877 forks source link

localhost:5000/v1/repositories/library/registry/tags doesn't work when MIRROR_SOURCE=https://registry-1.docker.io #981

Closed kbrowder closed 9 years ago

kbrowder commented 9 years ago

FYI, I'm new to this whole thing, but here's what I'm seeing when I look at the code: /v1/repositories/path:repository/tags route is decorated by https://github.com/docker/docker-registry/blob/master/docker_registry/lib/mirroring.py#L67, however this appears to use mirroring_cfg.source which as the documentation says should be https://registry-1.docker.io, which doesn't work since that means it GETs https://registry-1.docker.io/v1/repositories/library/registry/tags (which says authorization required), I believe it should query source_index instead which would give a mirroring GET to https://index.docker.io/v1/repositories/library/registry/tags which is correct.

I'm using the latest registry contrainer with redis linked, docker 1.4.1 (although that's not really relevant, curl http://localhost:5000/v1/repositories/busybox/tags should work).

I changed the MIRROR_SOURCE to be https://index.docker.io and curl works (gives an identical result to index.docker.io/v1/repositories/library/registry/tags) however the pull still doesn't (specifically it gives json: cannot unmarshal array into Go value of type map[string]string), which is strange since as I said, both urls have the same results, any thoughts?

dmp42 commented 9 years ago

cc @shin-

shin- commented 9 years ago

https://registry-1.docker.io/v1/repositories/library/registry/tags is the correct URL. You do need to obtain a token to access it, which docker pull should automatically take care of.

https://index.docker.io/v1/repositories/library/registry/tags has different data which isn't compatible with the registry endpoint of the same name.

kbrowder commented 9 years ago

Ah OK, hmmm, I was having a problem before without this, maybe it was something from a previous bad configuration cached in redis? Anyways I killed my redis and restarted it, and changed this back to the old default and things work fine, thanks, apologies again for the PEBKAC or whatever it was.