-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Proposal: allow for remote repository inspection #14258
Conversation
|
Anyone want to look at these? We want to use this to be able to verify an image is up 2 date. The idea is you have an image say foobar, which is based on rhel7-1.2. The Atomic tool searches through all of the images and searches for newer versions of rhel7 at the registry. When it finds one it reports to the user that they might want to rebuild the foobar image to use the newer layered image. Or to contact the provider of the foobar image to provide an updated version of the package. @crosbymichael @tianon @jfrazelle Anyone? |
| ) | ||
|
|
||
| type LookupRemoteConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document data structures according to Go's documentation guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
@stevvooe this in design review, code review is not required yet, otherwise it would need a rebase ;) |
|
@tiborvass If you lay code down before doing a proper exploration of the design space, it can be up for review. |
|
Before proceeding with this proposal, at least the following questions should be addressed:
|
|
|
Michal is in CZ, so he will respond tonight. |
Added new flag to `docker inspect` command:
$ docker inspect --remote <imageName>[:<tag>]...
Which inspects remote images. Additional `[:TAG]` suffix may further
specify desired `<image>`.
This allows for remote inspection without downloading image layers.
Log Tag, Digest and Registry to stderr as debug messages. Need to pass
`-D` flag to Docker client to see them.
Signed-off-by: Michal Minar <miminar@redhat.com>
|
@stevvooe Maybe there's a better name for remote image. The point is that downloading binary blobs and making remote image a local one just to inspect it is quite an expensive operation. The object of inspection is really an image stored either locally or at remote registry. But I don't think there are other areas where a concept of remote image could fit. You can't run, build or delete remote image. You may only pull it and create/update it with a |
|
@miminar I see. What if we explored the concept of a shallow pull? This would just pull the manifest and image json. It can be inspected and ran, but running would cause a full pull: This is a much better approach than adding the concept of "remotes" to the inspect command. Otherwise, we risk over-coupling remote image operations to commands that don't really have any notion of remote. |
|
How would this work? The end goal is to be able to just do a docker inspect content on remote registry for multiple images. Would the tooling need to do docker pull --shallow rhel7:latest Would the inspect work? Would it pull down the image? |
|
I would rather have something that actual performs the desired action. Going beyond that, I think this fits into the overall security strategy, where there ought to be a way to easily determine (w/o pulling) if your images are up to date (and their parents are up to date). |
|
Well it is bigger then just security. Basically you want to look at the image meta data on the registry. I might want to search for images with maintainer @cpuguy83, all images based on RHEL7, Or all images from Company XYZ... |
|
@cpuguy83 the intend is really a remote expect. The output we are looking for is the same as a local inspect would provide - with minor adjustments for some data that is not applicable in one of the cases. |
|
What about a tool that can inspect the remote registry? Adding more interaction with the registry to other commands will further couple the two commands. A local image and a remote image may have very different semantics. Some information output by the inspect command may not make sense for a remote image. By adding this command, we make the decision that these continue to remain coupled, which is directly against the current goal for the registry. |
|
There are some projects along those lines - like libdoug. But in this case we are deliberately trying to get to exactly the same On Wed, Jul 15, 2015 at 2:20 PM, Stephen Day notifications@github.com
|
|
You can add other METADATA that is different then the docker image json data, but we really just want to compare examine the local image json data the same way we examine the remote. The tooling we are building will first examine all local images before going to remote registries. Having two different tools for examining the same data seems a little crazy. |
|
There's really no reason I should have to pull and store any amount of data permanently within my local image cache to inspect a remote image. I also think I think that IMHO, however, in an ideal world, locals and remotes would be mostly indistinguishable, similar to git repos, and information about the "remoteness" of a repository should be syntactically encoded into how we refer to it on the CLI e.g. |
|
@rhatdan I agree the use case is valid but just adding this to The assumption that remote images have the same data is flawed. Images don't necessarily exist remotely. They may be only assembled when they reach a docker client. There is a massive effort to decouple the image distribution model to make it more flexible (at your request, even). The existence of features like this, where we make remote access sprawls over the UI, serve only to hold these efforts back. @willmtemple In fact, the suggestion of a "shallow pull" comes directly from git. While git may make remote and local seem indistinguishable, it is git's design that provides this very effective illusion. The local references in git provide a view into what is available remotely. Operations on remote repositories are only available through a restricted set of commands (push, pull, fetch, clone). We still have this proven design in docker. Right now, only push, pull, run, build and search interact with remote services. Adding I am not suggesting that users write their own clients to access this data. I am suggesting that we don't rush in a half-baked feature that violates the design goals. |
|
@stevvooe I think that makes sense in the context of git, where I can have a local repository with multiple configured remotes, and can fetch a remote without clobbering my own branches in the local scope. But when I If I understand this correctly: a "shallow" local repository would obey the normal contracts of an image except that when the user actually requires the image data, it is pulled? I'll retract my previous statement about this being a "generally bad idea," now that I've given it some thought. I can definitely see the use-case for that, but I think that the contract of Ultimately I don't think it will really matter whether it's an extension to |
|
@willmtemple I do agree that the missing piece between docker and git are discrete "remote" and "local" "branch heads". This isn't as bad with shallow if one runs a strict tag (say "2.0"), while a shallow might update "latest" but the conjoined model would be surprising. Taking this PR forward, it seems like we can do one of two things:
Also, remember that any solution should support digest references, as well. |
|
@stevvooe Sounds good. I like either of those solutions from a purely utilitarian standpoint as long as the ability to inspect a remote repository is obvious to the user. Going forward, @miminar has had to devote his attention to other areas, so after having a short conversation with him, I'm going to adopt this Pull Request. I do think that |
|
@willmtemple It sounds like you are head down the option 1 path. Let's not forget the following when we do eventually delete this functionality:
|
|
That is fine with us, since we plan on wrapping this functionality. We could even start out with it marked as deprecated if you want. I would prefer to see the idea of docker remote evolve and show up before we spend a lot of time building it, since you seem to understand it much better then we do. We do want to get access to the API via docker-py also, so we can talk to them about this. |
|
As I explained above, #14258 (comment), we want to use this capability in the atomic tool to tell users whether or not they are using older layered images. |
|
I haven't read this PR in every details, but I understand you reached an agreement on the path forward so I'm assuming you'll be ok with me closing this. |
Added new flag to
docker inspectcommand:Which inspects remote images. Additional
[:TAG]suffix may furtherspecify desired
<image>.This allows for remote inspection without downloading image layers.
Log Tag, Digest and Registry to stderr as debug messages. Need to pass
-Dflag to Docker client to see them.Resolves #14257