Skip to content

Add "VSize" to "Supported tags and respective Dockerfile links" #86

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

Closed
wants to merge 1 commit into from

Conversation

tianon
Copy link
Member

@tianon tianon commented Oct 26, 2014

Opening this for discussion. It takes quite a long time to fetch the "virtual size", since it has to walk the entire ancestry and the registry is really slow at handing back the JSON objects for each layer.

Fixes docker-library/openjdk#15

Here's an example from debian:

For comparison, here's golang:

And java:

@tianon
Copy link
Member Author

tianon commented Oct 26, 2014

I wanted to use base 1024 for the sizes, but docker images uses base 1000, so I used the same for consistency. When I rounded these to three decimal places (like docker images does), we were within 0.001 of the size Docker reports (which is likely just due to rounding differences, of course), but having three decimal places in our output here looked kind of ugly, so I dropped to just one (since then we still get a reasonable amount of information -- ie, 1.8 GB can be quite a bit different from 2 GB depending on your connection speed).

@tianon
Copy link
Member Author

tianon commented Oct 26, 2014

If we add the following patch too (which is not currently in this commit/PR), then any layer you have properly pulled on your local machine would result in a dramatic speedup (for time ./update.sh debian, we went from ~33s down to ~11s):

diff --git a/get-image-data.sh b/get-image-data.sh
index e18a1ed..c8aed80 100755
--- a/get-image-data.sh
+++ b/get-image-data.sh
@@ -69,6 +69,12 @@ case "$data" in
                echo "$imageId"
                ;;
        vsize)
+               total="$(docker inspect -f '{{printf "%.0f" .VirtualSize}}' "$imageId" 2>/dev/null || true)"
+               if [ "$total" ]; then
+                       echo "$(human_size $total)"
+                       exit
+               fi
+               
                ancestry=( $(curl -sSL -H "Authorization: Token $token" "https://registry-1.docker.io/v1/images/$imageId/ancestry" | sed -r 's/^\["|"\]//g; s/",[[:space:]]*"/ /g') )

                total=0

@SvenDowideit
Copy link
Contributor

awesome! and of course, if the v2 registry guys are aware of what you need to do, then they can improve it in v2 >:} - and then the docker daemon can tell the user stuff sooner too

ie are you sure you want to download 10GB of big-repo :)

@yosifkit
Copy link
Member

I think adding the speedup would definitely be helpful. We should probably add minimal documentation so that people updating the docs in a PR know not to run ./update on all the things or it will take "forever".

@yosifkit
Copy link
Member

@tianon do we want to rebase and merge this in?

@tianon
Copy link
Member Author

tianon commented Jan 23, 2015

@yosifkit I've been giving it some more though, and while I like the extra information, I think it's visually overloading an already tightly-packed section if we add it to this top header of every image, so I'm leaning more towards a "tag details" section or something like that with this kind of information in it; what do you think?

@yosifkit
Copy link
Member

That could be nice, but how much different would that be from the top section? How can we simplify both sections?

@tianon
Copy link
Member Author

tianon commented Jan 26, 2015

Yeah, I guess the biggest difference would be that it wouldn't need the Dockerfile link, and then it wouldn't need to be quite as compressed either, so we could do something more like: (but this is apt to get really, really long, especially in the case of something like jenkins that has about eleven trillion tags)

Tag Details

8.0, 8, jessie

oldstable

Virtual Size: 78.4 MB
Layers: 3

sid

...

6.0.10, 6.0, 6, squeeze

...

@tianon tianon added moreinfo and removed moreinfo labels Feb 3, 2015
@denibertovic
Copy link

+1 for this...it's very much needed.

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.

add documentation that makes it clear what the different tags contain
4 participants