-
Notifications
You must be signed in to change notification settings - Fork 795
canonicalization: Add recommendations for canonicalization #339
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Canonicalization | ||
|
|
||
| OCI Images [are](descriptor.md) [content-addressable](image-layout.md). | ||
| One benefit of content-addressable storage is easy deduplication. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's already explicitly called out as a goal @ https://github.com/opencontainers/image-spec/blame/e74c6c703315a8d2baaea691b527194377c33a8d/manifest.md#L4
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I stand corrected. I still think the current wording covers that though. Would you still prefer your initial suggestion? |
||
| Many images might depend on a particular [layer](layer.md), but there will only be one blob in the [store](image-layout.md). | ||
| With a different serialization, that same semantic layer would have a different hash, and if both versions of the layer are referenced there will be two blobs with the same semantic content. | ||
| To allow efficient storage, implementations serializing content for blobs SHOULD use a canonical serialization. | ||
| This increases the chance that different implementations can push the same semantic content to the store without creating redundant blobs. | ||
|
|
||
| ## JSON | ||
|
|
||
| [JSON][] content SHOULD be serialized as [canonical JSON][canonical-json]. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JSON content (for example, ...)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JSON content (for example all of the bla bla media types or bla bla manifests) SHOULD be serialized as |
||
| Of the [OCI Image Format Specification media types](media-types.md), all the types ending in `+json` contain JSON content. | ||
| Implementations: | ||
|
|
||
| * [Go][]: [github.com/docker/go][], which claims to implement [canonical JSON][canonical-json] except for Unicode normalization. | ||
|
|
||
| [canonical-json]: http://wiki.laptop.org/go/Canonical_JSON | ||
| [github.com/docker/go]: https://github.com/docker/go/ | ||
| [Go]: https://golang.org/ | ||
| [JSON]: http://json.org/ | ||
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.
Slightly more intro context - something like "One of the goals of the OCI Image Specification is to leverage content-addressable storage (CAS), which provides benefits like easy deduplication"