-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Conversation
I wanted to use base 1024 for the sizes, but |
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 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 |
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 |
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 |
@tianon do we want to rebase and merge this in? |
@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? |
That could be nice, but how much different would that be from the top section? How can we simplify both sections? |
Yeah, I guess the biggest difference would be that it wouldn't need the Tag Details
|
+1 for this...it's very much needed. |
Add debops.docker_gen role
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
:jessie
(jessie/Dockerfile) [VSize: 121.8 MB]oldstable
(oldstable/Dockerfile) [VSize: 78.4 MB]sid
(sid/Dockerfile) [VSize: 121.9 MB]6.0.10
,6.0
,6
,squeeze
(squeeze/Dockerfile) [VSize: 78.4 MB]stable
(stable/Dockerfile) [VSize: 85.1 MB]testing
(testing/Dockerfile) [VSize: 121.8 MB]unstable
(unstable/Dockerfile) [VSize: 121.9 MB]7.7
,7
,wheezy
,latest
(wheezy/Dockerfile) [VSize: 85.1 MB]rc-buggy
(debian/rc-buggy/Dockerfile) [VSize: 121.9 MB]experimental
(debian/experimental/Dockerfile) [VSize: 121.9 MB]For comparison, here's
golang
:1.2.2
,1.2
(1.2/Dockerfile) [VSize: 451.6 MB]1.2.2-onbuild
,1.2-onbuild
(1.2/onbuild/Dockerfile) [VSize: 451.6 MB]1.2.2-cross
,1.2-cross
(1.2/cross/Dockerfile) [VSize: 1.8 GB]1.3.3
,1.3
,1
,latest
(1.3/Dockerfile) [VSize: 449.7 MB]1.3.3-onbuild
,1.3-onbuild
,1-onbuild
,onbuild
(1.3/onbuild/Dockerfile) [VSize: 449.7 MB]1.3.3-cross
,1.3-cross
,1-cross
,cross
(1.3/cross/Dockerfile) [VSize: 1.8 GB]1.3.3-wheezy
,1.3-wheezy
,1-wheezy
,wheezy
(1.3/wheezy/Dockerfile) [VSize: 374.4 MB]And
java
:openjdk-6b32-jdk
,openjdk-6b32
,openjdk-6-jdk
,openjdk-6
,6b32-jdk
,6b32
,6-jdk
,6
(openjdk-6-jdk/Dockerfile) [VSize: 352.9 MB]openjdk-6b32-jre
,openjdk-6-jre
,6b32-jre
,6-jre
(openjdk-6-jre/Dockerfile) [VSize: 203.0 MB]openjdk-7u65-jdk
,openjdk-7u65
,openjdk-7-jdk
,openjdk-7
,7u65-jdk
,7u65
,7-jdk
,7
,jdk
,latest
(openjdk-7-jdk/Dockerfile) [VSize: 562.7 MB]openjdk-7u65-jre
,openjdk-7-jre
,7u65-jre
,7-jre
,jre
(openjdk-7-jre/Dockerfile) [VSize: 308.5 MB]openjdk-8u40-jdk
,openjdk-8u40
,openjdk-8-jdk
,openjdk-8
,8u40-jdk
,8u40
,8-jdk
,8
(openjdk-8-jdk/Dockerfile) [VSize: 634.8 MB]openjdk-8u40-jre
,openjdk-8-jre
,8u40-jre
,8-jre
(openjdk-8-jre/Dockerfile) [VSize: 284.2 MB]