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

OCI Layout commands #190

Open
1 task done
jonesbusy opened this issue Mar 5, 2025 · 2 comments
Open
1 task done

OCI Layout commands #190

jonesbusy opened this issue Mar 5, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jonesbusy
Copy link
Collaborator

jonesbusy commented Mar 5, 2025

What would you like to be added?

Interactive with an OCI layout

For the moment only copy to OCI layout is implemented

public void copy(ContainerRef containerRef, Path folder) {

Introduce a first level OciLayoutRegistry similar to Registry

Probably no need to implement all operation as a first step but perhaps

  • Push artifact to OCI layout (oras push --oci-layout my-layout:foo hello.txt)
  • Pull artifact from OCI layout (oras pull --oci-layout my-layout:foo --output tata)
  • Pull manifest from OCI layout (oras manifest fetch --oci-layout my-layout:latest)
  • Push manifest to OCI layout (oras manifest push --oci-layout my-layout:toto manifest)

Why is this needed for ORAS?

https://github.com/opencontainers/image-spec/blob/main/image-layout.md

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.
@jonesbusy jonesbusy added the enhancement New feature or request label Mar 5, 2025
@jonesbusy jonesbusy added this to the 1.0.0 milestone Mar 5, 2025
@jonesbusy
Copy link
Collaborator Author

jonesbusy commented Mar 6, 2025

Pushing artifact

Adding the org.opencontainers.image.ref.name witht the tag to the manifest descriptor on the index

{
  "schemaVersion": 2,
  "manifests": [
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:b006563b844fc673152358079b412c152977071484ac79088220571dabc70fb9",
      "size": 588,
      "annotations": {
        "org.opencontainers.image.created": "2025-03-06T04:59:31Z",
        "org.opencontainers.image.ref.name": "latest"
      },
      "artifactType": "application/vnd.unknown.artifact.v1"
    },
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:093d301674e46513e37321bce25498d47b55deb06afb36630e3689bcc609b5c9",
      "size": 588,
      "annotations": {
        "org.opencontainers.image.created": "2025-03-06T04:58:46Z"
      },
      "artifactType": "application/vnd.unknown.artifact.v1"
    },
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:97c660cc16a87c48f6f8a5b27e49fc15363581968e7c7b30485396c810c7b774",
      "size": 588,
      "annotations": {
        "org.opencontainers.image.created": "2025-03-06T04:58:06Z"
      },
      "artifactType": "application/vnd.unknown.artifact.v1"
    }
  ]
}

The manifest on the blobs doesn't change

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "artifactType": "application/vnd.unknown.artifact.v1",
  "config": {
    "mediaType": "application/vnd.oci.empty.v1+json",
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
    "size": 2,
    "data": "e30="
  },
  "layers": [
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar",
      "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
      "size": 0,
      "annotations": {
        "org.opencontainers.image.title": "sarif.json"
      }
    }
  ],
  "annotations": {
    "org.opencontainers.image.created": "2025-03-06T04:59:31Z"
  }
}

@jonesbusy jonesbusy self-assigned this Mar 7, 2025
@jonesbusy
Copy link
Collaborator Author

If tag not added

oras copy docker.io/library/alpine:latest --to-oci-layout foobar --debug

    {
      "mediaType": "application/vnd.oci.image.index.v1+json",
      "digest": "sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c",
      "size": 9218
    },

If tag added

oras copy docker.io/library/alpine:latest --to-oci-layout foobar:latest --debug

    {
      "mediaType": "application/vnd.oci.image.index.v1+json",
      "digest": "sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c",
      "size": 9218,
      "annotations": {
        "org.opencontainers.image.ref.name": "latest"
      }
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant