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

Fix publishing OCI image as tarball #44693

Merged
merged 6 commits into from
Nov 11, 2024

Conversation

surayya-MS
Copy link
Member

@surayya-MS surayya-MS commented Nov 6, 2024

Context

Currently, when customers use our tooling to publish containers as tarballs, both Docker and OCI images are saved as a tarball that has Docker tarball format. The produced tarball can be consumed by other tooling like Docker or Podman. However, this is incorrect, as OCI image tarballs should follow a distinct structure specific to the OCI format. The correct OCI tarball can be consumed by Podman and other tooling that understands OCI tarballs.

Customer impact

Without this change, customers will continue to receive improperly structured OCI tarballs.

Details

OCI image tarball structure should look like https://github.com/opencontainers/image-spec/blob/main/image-layout.md#oci-layout-file

Changes

  1. Fixed tarball creation for OCI image
  2. Added 'annotations' to ImageIndexV1 manifests entries. (this is needed to set image name and tag in the tarball)

Testing

  1. Added tests that check correct Docker/OCI image tarball structure
  2. Tested manually by loading the produced OCI image tarball with Podman.

Risk

Low - the existing tests ensure that other scenarios were not affected.

@surayya-MS surayya-MS requested a review from a team as a code owner November 6, 2024 20:57
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Containers Related to dotnet SDK containers functionality untriaged Request triage from a team member labels Nov 6, 2024
@surayya-MS surayya-MS added DO NOT MERGE and removed untriaged Request triage from a team member labels Nov 6, 2024
@surayya-MS surayya-MS self-assigned this Nov 7, 2024
@surayya-MS surayya-MS changed the title Fix OCI image tarball Fix publishing OCI image as tarball Nov 8, 2024
@surayya-MS
Copy link
Member Author

Approved over email

@surayya-MS surayya-MS merged commit cc39718 into dotnet:release/8.0.4xx Nov 11, 2024
17 checks passed
@surayya-MS surayya-MS deleted the fix-oci-tarball branch November 11, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Containers Related to dotnet SDK containers functionality DO NOT MERGE Servicing-approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants