Skip to content
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

Inspect remote images #5

Closed
wants to merge 0 commits into from
Closed

Conversation

miminar
Copy link
Owner

@miminar miminar commented May 11, 2015

Added new flag to docker inspect command:

$ docker inspect --remote <imageName>[:<tag>]...

Which inspects remote images. If a short name is given, all additional registries will be queried until a match is found. Additional [:TAG] suffix may further specify desired <image>.

This allows for remote inspection without downloading image layers.

@miminar miminar changed the title Fixed push of unqualified registry Inspect remote images May 11, 2015
@miminar miminar force-pushed the remote-inspect branch 2 times, most recently from ee1a73c to 65af130 Compare May 11, 2015 09:02
@miminar
Copy link
Owner Author

miminar commented May 11, 2015

@llunved Could you please take a look? I'll make a scratch build for you to try.

@miminar miminar force-pushed the additional-registries branch 2 times, most recently from bdcbeeb to e73a596 Compare May 18, 2015 07:46
@miminar miminar force-pushed the remote-inspect branch 3 times, most recently from de208e7 to 973f00c Compare May 20, 2015 12:02
@miminar miminar force-pushed the additional-registries branch 2 times, most recently from 2837864 to 5400f21 Compare May 25, 2015 07:06
@llunved
Copy link

llunved commented Jun 9, 2015

An initial smoke test shows that this appears to be generally working as intended. Two possible issues:
"docker inspect --remote docker.io/tomcat" vs the "docker inspect docker.io/tomcat" shows a slightly different output:

<     "VirtualSize": 0,
<     "Registry": "docker.io",
<     "Digest": "sha256:3ab045cce1bc1a73516596474bee0073206ce4843a85fccf8f1329a35625543b",
<     "Tag": "latest"
---
>     "VirtualSize": 347798454

Also there is error output on local inspect:

# docker inspect docker.io/tomcat 1> /dev/null
INFO[0658] GET /v1.19/containers/docker.io/tomcat/json  
ERRO[0658] Handler for GET /containers/{name:.*}/json returned error: no such id: docker.io/tomcat 
ERRO[0658] HTTP Error                                    err=no such id: docker.io/tomcat statusCode=404
INFO[0658] GET /v1.19/images/docker.io/tomcat/json     

I don't see that with earlier versions of docker.

@miminar
Copy link
Owner Author

miminar commented Jun 12, 2015

@llunved Thanks for checking it out.
VirtualSize needs to be computed locally like this:

VirtualSize = img.Size + sum([img.getNthParent(n).Size for n in range(1, img.numParents + 1)])

So we could:

  • pull all the parent json files and make this computation - could make it time consuming
  • remove this attribute completely from output
  • leave it as it is

Must the output of remote inspect match the local one? I've added Registry, Digest and Tag attributes because they may be interesting to the user. If he has several additional registries and inspects image identified by a short name, he should get at least the source registry information. But perhaps it could be logged as INFO messages to stderr. WDYT?

As for the error messages, they aren't shown in the latest version. However, they will appear in Docker daemon's journal -- and the same applies to older versions without these patches.

@llunved
Copy link

llunved commented Jun 12, 2015

@miminar I looked at it again.

  • The error is gone
  • On vritual size does the server simply return size of 0 or is the field not returned but the client just shows 0? We should probably filter out fields that are not returned by the server, but conversely we should keep all the fields the server does actually return, even if they are 0.
  • The other thing that confused me was the Digest and Tag missing... But again, if the data isn't there (locally in this case), we shouldn't make it up...

Overall LGTM

@miminar
Copy link
Owner Author

miminar commented Jun 12, 2015

On 12.6.2015 16:51, llunved wrote:

@miminar https://github.com/miminar I looked at it again.

  • The error is gone
  • On vritual size does the server simply return size of 0 or is the field not returned but the client just shows 0? We
    should probably filter out fields that are not returned by the server, but conversely we should keep all the fields
    the server does actually return, even if they are 0.
    Registry doesn't return it. It's created and computed by client. I'll filter it out.
  • The other thing that confused me was the Digest and Tag missing... But again, if the data isn't there (locally in
    this case), we shouldn't make it up...
    Ok, I'll remove them. I'll at least make this information appear in debug messages on stderr.

Overall LGTM


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

@miminar miminar force-pushed the additional-registries branch 6 times, most recently from 7e36fcc to ebff6d8 Compare August 17, 2015 12:29
@miminar miminar closed this Sep 7, 2015
@miminar miminar deleted the remote-inspect branch September 7, 2015 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants