Skip to content

docker pull queries for all repository images and tags #10563

Closed

Description

@danp

Description of problem:

When I docker pull example.org/fooo/barr:bazz, I would expect the registry to receive a request at, say:

/v1/repositories/fooo/barr/tags/bazz

Instead these endpoints are hit:

/v1/repositories/fooo/barr/images
/v1/repositories/fooo/barr/tags

If the repository has a large number of images and/or tags, this causes much more work for the registry, the network, and the client than should be necessary.

docker version:

Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8
OS/Arch (client): darwin/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8

docker info:

Containers: 41
Images: 579
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Dirs: 661
Execution Driver: native-0.2
Kernel Version: 3.16.7-tinycore64
Operating System: Boot2Docker 1.4.1 (TCL 5.4); master : 86f7ec8 - Tue Dec 16 23:11:29 UTC 2014
CPUs: 4
Total Memory: 1.961 GiB
Name: boot2docker
ID: RWCD:HRLO:LBEH:E6M7:S35X:LPNQ:FQFU:2HGZ:F77R:H6PF:MEVM:LD2F
Debug mode (server): true
Debug mode (client): false
Fds: 11
Goroutines: 13
EventsListeners: 0
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker

uname -a:

Darwin lemonade.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

Environment details (AWS, VirtualBox, physical, etc.):

  • boot2docker

How reproducible:

Very, I think.

Steps to Reproduce:

  1. Have a private registry?
  2. docker pull example.org/fooo/barr:bazz

Actual Results:

Index endpoints are hit.

Expected Results:

Specific endpoints are hit.

Activity

  1. dmp42 commented on Feb 4, 2015

    @dmp42
    Contributor

    The reason for this is tag aliases. There is a feeling now that this feature is/was a bad idea, but to change the behavior we need to deprecate the feature.

  2. danp commented on Feb 4, 2015

    @danp
    Author

    Suggestions on PRs that would help either cause (deprecation or fetching too much)? Could something be done to specify one doesn't care about aliases?

  3. dmp42 commented on Feb 4, 2015

    @dmp42
    Contributor

    A couple of related issues here: #8689 and here #8141

    @bobrik share the same concerns as far as I can tell - and the GCS people were bitten by this as well on the registry side (tags list lookup are quite costy there).

    I would suggest that you:

    • open an issue suggesting removal of the feature, documenting exactly what would change in the UX and documentation, explaining the reasons for this removal, and gathering feedback on it
    • reach consensus with the community and the maintainers on it
    • then submit a PR to remove/deprecate the feature and update the doc
    • optimizing v1 round trips following that might happen as a follow-up, or be part of that PR

    Hope that helps.

  4. thaJeztah commented on Feb 4, 2015

    @thaJeztah
    Member

    Yes, this is a pretty nasty side-effect. When proposing originally, I was under the assumption that the registry would have an efficient way to deal with this (basically, "image -> hasMany -> tags"), and pulling aliases would simply mean "tagging the same image with all it's aliases". Having to check all possible tags to check if they're possibly an alias is highly inefficient.

    Reading #8689 I've come to understand that V2 will even move further away from this idea; tagging the same image twice (e.g. both ":build-number and :latest) will produce two different image-ids. This will make it impossible to pull aliases (and also impossible to check if two images are the same, just a different tag)

  5. jessfraz commented on Feb 4, 2015

    @jessfraz
    Contributor

    closing as duplicate of #8689 and I will make a PR to remove the feature.

  6. jessfraz commented on Feb 4, 2015

    @jessfraz
    Contributor

    made a patch here #10571

  7. thaJeztah commented on Feb 5, 2015

    @thaJeztah
    Member

    FYI I asked to have this re-opened because removing the "pull all aliases" feature won't solve the problem that docker hits the mentioned end points. For reference, see the discussion on #10571

  8. danp commented on Feb 5, 2015

    @danp
    Author

    Sounds good! I will try to open a PR to fix the problem I've described here by having docker hit the specific tag endpoint.

  9. danp commented on Feb 5, 2015

    @danp
    Author

    I've dug into this and there are at least these problems so far, please correct me if I'm wrong on any of them:

    Maybe waiting for the v2 registry stuff would be the best option.

  10. changed the title [-]`docker pull` queries the registry for all images and tags[/-] [+]`docker pull` queries for all repository images and tags[/+] on Feb 5, 2015
  11. added
    kind/enhancement
    on Mar 2, 2015
  12. termie commented on Mar 10, 2015

    @termie
    Contributor

    +1

  13. danp commented on Mar 10, 2015

    @danp
    Author

    I got the new registry going and I think this issue is solved by the v2 API and the way the client side interacts with it. There was concern about the manifest history attribute growing without bounds similar to /v1/repositories/fooo/barr/images but after testing some subsequent normal operations that didn't seem to be the case.

  14. danp commented on Apr 17, 2015

    @danp
    Author

    With the new registry (and associated supported API) and docker 1.6.0 released I think this can be considered fixed.

  15. thaJeztah commented on Apr 17, 2015

    @thaJeztah
    Member

    Thanks @dpiddy and happy to hear you enjoy the improvements made!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    exp/expertkind/enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions