Skip to content

make docker pull only the latest tag by default#7759

Merged
crosbymichael merged 3 commits intomoby:masterfrom
unclejack:pull_latest_by_default
Sep 8, 2014
Merged

make docker pull only the latest tag by default#7759
crosbymichael merged 3 commits intomoby:masterfrom
unclejack:pull_latest_by_default

Conversation

@unclejack
Copy link
Contributor

This PR changes docker pull to add a flag called --all-tags (-a for the short version) to make Docker pull only the latest tag of a repository by default.

These changes are limited to the Docker CLI. The API and the daemon aren't modified for this change.

This will help speed up pulls. This PR is also removing the --tag flag because it doesn't make sense to keep it around any more.

The docs have been added, thanks to @SvenDowideit.

@unclejack
Copy link
Contributor Author

ping @dmp42

@unclejack unclejack force-pushed the pull_latest_by_default branch from 0db5b83 to cbbb1ab Compare August 27, 2014 12:51
@LK4D4
Copy link
Contributor

LK4D4 commented Aug 27, 2014

LGTM

1 similar comment
@dmp42
Copy link
Contributor

dmp42 commented Aug 27, 2014

LGTM

@dmp42
Copy link
Contributor

dmp42 commented Aug 27, 2014

@unclejack can you rebase?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we always set the tag to "" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems unused.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, so why not remove this line ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vieux I was under the impression it's still needed in the API. I'll remove it.

@SvenDowideit
Copy link
Contributor

yup :) needs Docs

@SvenDowideit
Copy link
Contributor

@unclejack I've made you unclejack#5

I guess we need something in the API too?

@unclejack
Copy link
Contributor Author

@SvenDowideit Thank you! I've merged the docs changes you've made into this branch.
We don't have to change anything in the API, the changes were made only on the client.

Those who use the API can already choose to append :latest to pull only the latest image, so I don't think we have to make any change there.

@unclejack unclejack force-pushed the pull_latest_by_default branch from 4c18872 to b7b8467 Compare August 29, 2014 14:38
@unclejack
Copy link
Contributor Author

@crosbymichael @tiborvass @vieux This PR is ready for code review.

@fredlf @jamtur01 Can you take a look at this PR, please? Thanks to @SvenDowideit, it now has docs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should omit this line. It belongs in release notes, not reference, IMHO. It won't be relevant after a couple of releases.

@fredlf
Copy link
Contributor

fredlf commented Aug 29, 2014

Docs LGTM if we omit the line I commented on.

@tianon
Copy link
Member

tianon commented Aug 29, 2014

I've gotta say, I really dislike this change a lot, but I understand the
justification (consistent experience etc).

@unclejack
Copy link
Contributor Author

@tianon Could you explain why you dislike the change, please? Most users really want to use the latest tag or don't care much about this and they end up using bandwidth.

@tianon
Copy link
Member

tianon commented Aug 29, 2014

Well, right now, when I "docker pull xyz", it's completely unambiguous what
I mean. I'm asking Docker to pull a "repository", which is a collection of
tags, so I logically understand that to mean that it pulls all tags. If I
only wanted one, I should've done "docker pull xyz:abc" instead. I'd love
to see us deprecate ":latest" tags entirely, to be honest, but they're a
nice abstraction during "docker run" so you can have pretty things like
"docker run -it ubuntu bash" and it actually does something useful (which
is why I support this particular "bare repo means :latest" behavior for
"docker run").

@wyaeld
Copy link

wyaeld commented Sep 2, 2014

As a user I'm +1 on this. It seems a safer default.

I think people quickly get to the point where they understand the distinction @tianon is talking about, but I'd disagree that the interpretation that the normal users intent is to have the entire collection of tags.

Sometimes you just get unpleasantly surprised by how big something is, or how many tags they have. For the new users, seeing a huge amount of stuff coming down the pipe when they just want to get started is a turnoff. It isn't helped by the fact that if the ctrl+c it, the client doesn't always gracefully reset.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that read --all-tags instead of --all-images?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmp42 You're right, I'll change this with the next update. I need to add some changes for docker builld.

@tianon
Copy link
Member

tianon commented Sep 2, 2014

Just out of curiosity, do we get a good error message if we do something
like "docker pull --all-tags debian:wheezy" ?

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <[email protected]> (github: unclejack)
@unclejack unclejack force-pushed the pull_latest_by_default branch 2 times, most recently from cc1ebfe to 6ba5d67 Compare September 3, 2014 15:32
SvenDowideit and others added 2 commits September 3, 2014 18:32
Docker-DCO-1.1-Signed-off-by: SvenDowideit <[email protected]> (github: SvenDowideit)
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <[email protected]> (github: unclejack)
@unclejack
Copy link
Contributor Author

@tianon Yes, you'll get an error saying tag can't be used with --all-tags/-a.

I've updated the PR to make docker build only pull the latest tag. This change also didn't require any API changes. The latest tag was always used for building if no tag was specified, so it makes sense to pull only the latest tag for a build.

I don't think the docker build change requires any changes to the docs. Please let me know if you think we should add docs somewhere.

@fredlf I've removed that line.
@fredlf @SvenDowideit Please take a look at the docs and let me know if you'd like to make any changes. I've updated the line with --all-images and the line below it.

@crosbymichael @jfrazelle @LK4D4 @tiborvass @vieux This should be ready for review. Please let me know if there's anything you'd like to change.

@tianon
Copy link
Member

tianon commented Sep 3, 2014

Thanks for clarifying, unclejack. :)

I'm +1 on consistency, and I'll get used to the new interface. :)

@dmp42
Copy link
Contributor

dmp42 commented Sep 3, 2014

LGTM

@thaJeztah
Copy link
Member

The latest tag was always used for building if no tag was specified, so it makes sense to pull only the latest tag for a build.

👍 thanks unclejack !

@fredlf
Copy link
Contributor

fredlf commented Sep 4, 2014

Docs LGTM

1 similar comment
@jamtur01
Copy link
Contributor

jamtur01 commented Sep 4, 2014

Docs LGTM

@shykes
Copy link
Contributor

shykes commented Sep 8, 2014

Design LGTM

@jessfraz
Copy link
Contributor

jessfraz commented Sep 8, 2014

is it possible to add a test for this? or is it too complicated at this point to make sure the latest is always the latest, etc
or maybe pull ubuntu and ubuntu:latest and compare sha's

@unclejack
Copy link
Contributor Author

@jfrazelle I think we can do this if we set up a mock registry to pull from it, but I think it's out of scope of this PR.

@jessfraz
Copy link
Contributor

jessfraz commented Sep 8, 2014

makes sense LGTM

On Mon, Sep 8, 2014 at 10:56 AM, unclejack [email protected] wrote:

@jfrazelle https://github.com/jfrazelle I think we can do this if we
set up a mock registry to pull from it, but I think it's out of scope of
this PR.


Reply to this email directly or view it on GitHub
#7759 (comment).

@tiborvass
Copy link
Contributor

LGTM

1 similar comment
@crosbymichael
Copy link
Contributor

LGTM

crosbymichael added a commit that referenced this pull request Sep 8, 2014
make docker pull only the latest tag by default
@crosbymichael crosbymichael merged commit 85314e7 into moby:master Sep 8, 2014
@unclejack unclejack deleted the pull_latest_by_default branch September 8, 2014 23:51
bfirsh added a commit to bfirsh/fig that referenced this pull request Dec 9, 2014
This was changed in Docker recently:

moby/moby#7759

This means we aren't pulling loads of tags when we only use the
latest.

Signed-off-by: Ben Firshman <[email protected]>
bfirsh added a commit to bfirsh/fig that referenced this pull request Dec 11, 2014
This was changed in Docker recently:

moby/moby#7759

This means we aren't pulling loads of tags when we only use the
latest.

Signed-off-by: Ben Firshman <[email protected]>
bfirsh added a commit to bfirsh/fig that referenced this pull request Dec 11, 2014
This was changed in Docker recently:

moby/moby#7759

This means we aren't pulling loads of tags when we only use the
latest.

Signed-off-by: Ben Firshman <[email protected]>
bfirsh added a commit to bfirsh/fig that referenced this pull request Dec 11, 2014
This was changed in Docker recently:

moby/moby#7759

This means we aren't pulling loads of tags when we only use the
latest.

Signed-off-by: Ben Firshman <[email protected]>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
This was changed in Docker recently:

moby/moby#7759

This means we aren't pulling loads of tags when we only use the
latest.

Signed-off-by: Ben Firshman <[email protected]>

Signed-off-by: Yuval Kohavi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.