Repository navigation
Conversation
|
Thanks @runcom There have been several discussion threads on this, and many topics raised for discussion. Trying to summarize here so we get a global view on this (happy to mark the items solved as we go, in this comment):
|
tested against registry v2.3.0 which shouldn't have foreign layer support:
Following is the output when validation is enabled (but I've also opened distribution/distribution#2035 to be stricter):
This can be further enhanced I guess. since it's coming from https://github.com/docker/distribution/blob/master/registry/storage/schema2manifesthandler.go#L127:
It will simply retries to get the blob and eventually fail with
What's DCT?
We don't (at least to me) - and this is orthogonal to this feature now, since this support is already in for Windows images. Bikeshedding on this topic can be done in a separate issue since the feature is simple enough to extend it in the future.
http and https
it does to my testing
There's no such thing at the moment. I can open a PR in docker/distribution to prevent altogether a push of a private manifest with a foreign layer or just provide a feeback to the user (how then... can we just document this at this point? see also about authentication above) |
385c207 to
3511095
Compare
|
Ok, updated my comment to track progress. Couple of notes: Indeed, let's try to make the messages a bit better where we can.
Docker Content Trust https://docs.docker.com/engine/security/trust/content_trust/
We disagree on that - this was discussed at length already. There is a major difference between a platform requirement, and opening foreign layers to image producers.
I disagree as well. If we don't have a clear vision on how that could be done in the future, we will likely have to break compatibility yet again, which is something bad enough to not be dismissed.
The registry itself does not have knowledge about the "privacy" status of a manifest, it's a concept that belongs to the authn server. I think the best we can do is to output a clear warning to the user pushing the manifest that this will effectively leak data regardless of the "privacy" status of the image on the registry. Adding a couple more questions to solve (added them in my initial comment as well):
Also, breaking backward compatibility is the main unresolved issue here (eg: this may warrant bumping the manifest schema version for these manifests). |
seems so to my testing, digests won't change so DCT still works ok resolving names->digests correctly
docker can already do this with this patch (and windows can do this already)
No, the foreign layer is never pushed even after tagging another image
I never heard of any issue on the windows side of this work which is already in place...
I'm fine adding a warning when pushing a private image with foreign layers (need to figure out how to do this in docker though) |
We disagree here, it's not breaking backward compatibility. That's forward compatibility (since we did add urls after 1.10.3 for instance). A new image built with foreign layers will of course not being able to be pulled by older clients, it's not breaking anything, it's a new feature which can't be used on older clients...
This is your call, I'd love to understand this soon though, not just saying we could bump (and again, as stated above I don't think this is breaking anything except new features not working with older clients...) |
Using the same protocol version and APIs, it would now be possible to push an image that can't be pulled by older clients. This is a breaking change (see below).
We would be breaking the fundamental assumption that any image pushed by any engine version is pull-able by any other engine version. We made radical changes and upgrade twice in 18 months:
I would rather have us talk about this and come to an agreement together.
Is the above ^ clarifying why this would be indeed a breaking change that might deserve at the very least a schema version bump and documentation discouraging its use for the time being, and ideally a server-side solution to proxy-cache / rewrite for older clients? |
|
@dmp42 side note, could you update your comments with checklist above with my testing from #27961 (comment)
Alright, I understand that. I understand a version bump may be required in this case. I don't think we can't actually proxy anything in this scenario though, as already noted elsewhere, the whole point of this feature was to not host layers on a registry. Caching them will break this assumption. Rewriting the manifest will very likely break pull-by-digest again (we can write out the urls maybe and compute the digest w/o urls to preserve the digest but it sounds like an ugly hack to me). |
|
Ping @dmp42 I would also note that what you're asking here is impossible (as it was when upgrading schema1 to schema2). I can only imagine a mechanism for old clients where the blob is just proxied from the registry and never kept there. How do you do this? Hopefully the Docker clients send a version header to the registry and we can programmatically chose when to proxy the blobs. Maybe. Or, schema3, clients advertise what they support. But then pull by digest is broken again when rewriting manifests. Do you have any other thoughts, opinion, concerns? |
|
I don't see any other blocking concerns here. Can this be merged? |
3511095 to
5dafaea
Compare
cbf48e5 to
860f32b
Compare
Signed-off-by: Antonio Murdaca <[email protected]>
860f32b to
aa32f92
Compare
Signed-off-by: Antonio Murdaca <[email protected]>
aa32f92 to
296453c
Compare
I suggest you look again.
No. |
|
@runcom : Regarding the reported plugin issues:
|
clients < 1.12.x will be broken anyway I guess (I'll re-test) |
|
@runcom : Ofcourse. We don’t plan to fix all older clients, especially given that the panic is in the client and hence non-critical. |
old users will be broken as is the case in this PR if |
|
|
||
| purl, _ := url.Parse(u) | ||
| var tlsc *tls.Config | ||
| tlsc, err = ld.service.TLSConfig(purl.Host) |
There was a problem hiding this comment.
Do we need to inject the entire service just to get access to the TLSConfig?
There was a problem hiding this comment.
Mm yeah, we need a way to get the tls config. I'll fix that when in code-review if it's not OK to have the service injected here (which I don't like either).
There was a problem hiding this comment.
@runcom I'd prefer we avoid it, as it is hard to remove later.
|
@LK4D4 I think we're okay here. I just had a question about injecting the service for the purpose of getting a tls config. |
|
@aaronlehmann @dmcgowan Are we okay with the design here? |
|
design 👍 |
|
@aaronlehmann feel free to move to code-review if design is ok for you. |
|
@dmp42, I see you had a list of concerns. Do you think those have been adequately addressed? |
I think this statement ^ is pretty clear about the status and intentions of this. It is definitely a no from me. |
@dmp42 You simply stated that this change requires an api bump in image manifests while other stuff already implemented didn't (plugins?) (#27961 (comment)). I'm arguing since you didn't bump for plugins, you shouldn't bump for this change also. But still, even if I'm totally mistaken and this requires an API bump, are you keen to do that? this PR and the other old ones simply were a "No" or "let's change that before" and I did it (in docker/distribution). So, can we just sit together and decide what to do? |
|
@dmp42 I'm not sure to follow. The I also do agrees with @runcom regarding plugins is kinda broken on @stevvooe @dmcgowan @aaronlehmann wdyt ? |
If we want this to succeed, we need to introduce it in a way that makes it possible for registry operators to roll it out without having to just blow existing users. I don't think we can just tell them: "hey, enable it, it's fine, some of the images will just break cryptically (complaining about a missing layer after repeatedly trying to fetch it) for some of your users". Maybe there is a better solution than an API bump to achieve decent user experience - am open to that.
It probably should have been bumped - and plugins should have been done differently IMHO (at least, not break like that).
I believe everybody here spent quite some time looking at this.
Propose a solution that achieves decent user experience for older versions (as discussed in the previous comments)
See above.
We can have it, granted the original checklist is ok, and we find a solution for ^
Sure, it's fine to debate solutions - requirement being: decent experience for users (backward compat / graceful fallback) and something usable for operators. Happy to discuss this more. |
|
To tell you the truth, this discussion is around forward compatibility, which I don't think we've ever intended to support. Making these backwards compatible would mean serving up the layers directly from the registry or from the URL. I also don't think a version bump will help here. We seem to think that is the solution to everything but we still have problems when bumping versions. The main problem here is that the engines should say they have encountered an incompatible image type. We can backport a patch for this if it is a big deal, but I don't think there is any expectation that these images can work. In the least, we need to add messaging around cases where images cannot supported, as this problem will only grow with plugins, multiarch and the wonders of OCI. This is a growing problem that needs to be addressed anyways. In general, software proprietors need to be selective in using this feature. If you push content that relies on The other thing to consider is that this functionality is under control of registry operators, as well. If a registry operator chooses not to accept URLs, or a specific set of URLs, then so be it, that is their policy. Either way, I don't think we should be holding this up any longer. I agree with @runcom: plugins were pushed with one tenth of the scrutiny this is getting. Let's move forward with this and work out the problems. Obviously, I would hope that @runcom would volunteer to take on the extra maintenance burden. |
yeah, but that will totally defeat the whole purpose of having layers sitting outside registries I guess.
|
I think we agree there can't be any graceful fallback as again that will totally defeat the whole purpose of this feature...for backward compat we need to find a way to immediately error out if the client is old, agree. |
@anusha-ragunathan for the record, none of those points are actually handling backward compatibility...with an older docker client, you still get a panic (e.g. v1.10.3), thus, if you switched an image reference from an image to a plugin, you broke those clients: $ ./bundles/1.10.3/dynbinary/docker pull tiborvass/no-remove
Using default tag: latest
latest: Pulling from tiborvass/no-remove
961d35be79b4: Pull complete
unexpected EOF
$
# panic
2017/02/20 18:18:20 http: panic serving @: runtime error: invalid memory address or nil pointer dereference
goroutine 15 [running]:
net/http.(*conn).serve.func1(0xc42035a380)
/usr/lib/golang/src/net/http/server.go:1491 +0x15c
panic(0x14d4dc0, 0xc4200100c0)
/usr/lib/golang/src/runtime/panic.go:458 +0x271
github.com/docker/docker/distribution.(*v2Puller).pullSchema2(0xc4207e9860, 0x1eff8a0, 0xc4206df6c0, 0x7efcb11d5260, 0xc4206cfcc0, 0xc420d9e460, 0xc4209fd900, 0x47, 0xc4209fd9f0, 0x47, ...)
/home/amurdaca/go/src/github.com/docker/docker/.gopath/src/github.com/docker/docker/distribution/pull_v2.go:473 +0xc4c
github.com/docker/docker/distribution.(*v2Puller).pullV2Tag(0xc4207e9860, 0x1eff8a0, 0xc4206decc0, 0x7efcb11d5260, 0xc4206cfcc0, 0xa, 0xc4206cfd50, 0x1)
/home/amurdaca/go/src/github.com/docker/docker/.gopath/src/github.com/docker/docker/distribution/pull_v2.go:267 +0x820
[...] |
| func (rl *roLayer) Descriptor() distribution.Descriptor { | ||
| return rl.descriptor | ||
| } | ||
|
|
There was a problem hiding this comment.
nit: put these after the type roLayer ....
|
I don't see this adding a new media type. Thus the manifests with URLs pointing to custom content servers can be crafted even now without clients being able to handle them. Docker Hub is safe since it whitelists urls already. I don't suppose Docker will add the tooling to let users easily specify the URLs for the dependencies of the manifest to be created. And if yes, it won't encourage them to do so. So if the software proprietor uses some custom tooling to do it for some legal reasons, he is to be blamed by not intended audience if it fails to pull his images. If someone manages to pull it and re-distribute it, his image will inherit the bad reputation. Docker doesn't guarantee that the content is run-able. In some cases, it does not even guarantee that it is serve-able. This PR just increases a motivation to do the latter (with private registries) without introducing the tools to do so. On the other hand, it gives more freedom to software vendors. And that goes hand in hand with responsibility. Maybe such images can be marked with some special symbol in Docker Hub/Store saying that this content is partially served by third party vendor. This could help direct the consumers to blame the proprietor / image author, not the engine if something goes wrong. That's of course of out scope of this PR. Regarding some of the open questions in the #27961 (comment) above, to my understanding: Auth
I imagine the authentication happening on client side only. I don't see a need for registry to Stat the blobs on its own. I believe the Docker client should allow for updating the .config with credentials for blob urls (e.g. For all the federated blobs it is unauthorized to get, the docker client could:
If there's one or more blobs coming from the same endpoint with the credentials, I'm asked just once. If there are more federated blobs coming from different endpoints, each requiring authentication and I see three different prompts in a row, I give up and start thinking this software vendor went nuts. It's up to the software vendor to keep the access to the blobs simple if he strives for happy customers. This doesn't aim to be a solid proposal. It's just an example trying to prove that adding UX to the future authentication is possible and may not be that much complicated. If you disagree, let's discuss it. I'm positive we can find a working solution. Private images
Maybe I'm missing something, but I don't see anything wrong about private image with federated layers. I base my application on a publicly accessible base layers of some sw proprietor. I cannot claim I own these layers and I don't claim them. I just want to keep my top-level application private. If I add a federated layer of my own on top, I surely am aware of that (since there's no official tooling) and I'm not interested in this kind of feedback. I consider the last three questions already answered by @runcom. The design LGTM. |
|
@vdemeester No objections to opening up foreign url support on pull, with or without the datatype. There may still be some UX issues to work out. cc @friism @miminar These aren't really meant for applications that require authentication. This is only for applications that require that layers come from a specific source. If you want to propose an authentication subsystem, please do so in another issue: let's keep this focused on pure foreign layer support. |
|
ping |
|
@runcom this one needs to be rebased |
|
Closing since this went stale. |
Resurrecting #23014
Based on @dmp42's comment #23014 (comment)
Based on discussion at distribution/distribution#1825
This is the last piece needed to enable layers federations on non-Windows OSes.
/cc @stevvooe @vbatts @dmp42 @aaronlehmann