Support manifest commands in ORAS CLI #340
sajayantony
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
Here are my shower thoughts. /cc @qweeah @sajayantony @FeynmanZhou @yizha1 OverviewThe proposed command is
The Similarly, we can have ScenariosFetch a manifest by tag:oras fetch-manifest docker.io/library/hello-world:latest Fetch a manifest by digest:oras fetch-manifest docker.io/library/hello-world@sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4 Fetch a raw manifest:oras fetch-manifest -r docker.io/library/hello-world:latest Fetch a manifest by platform:oras fetch-manifest --platform arm/linux/v7 docker.io/library/hello-world:latest Fetch a manifest in debug, showing all headers with auth sanitized:oras fetch-manifest -d docker.io/library/hello-world:latest Fetch a manifest in verbose mode, showing the descriptor of the manifest:oras fetch-manifest --platform amd64/linux -v docker.io/library/hello-world:latest Output (basically the OCI descriptor in the {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"digest": "sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4",
"size": 525,
"data": "ewogICJzY2hlbWFWZXJzaW9uIjogMiwKICAibWVkaWFUeXBlIjogImFwcGxpY2F0aW9uL3ZuZC5kb2NrZXIuZGlzdHJpYnV0aW9uLm1hbmlmZXN0LnYyK2pzb24iLAogICJjb25maWciOiB7CiAgICAibWVkaWFUeXBlIjogImFwcGxpY2F0aW9uL3ZuZC5kb2NrZXIuY29udGFpbmVyLmltYWdlLnYxK2pzb24iLAogICAgInNpemUiOiAxNDY5LAogICAgImRpZ2VzdCI6ICJzaGEyNTY6ZmViNWQ5ZmVhNmE1ZTk2MDZhYTk5NWU4NzlkODYyYjgyNTk2NWJhNDhkZTA1NGNhYWI1ZWYzNTZkYzZiMzQxMiIKICB9LAogICJsYXllcnMiOiBbCiAgICB7CiAgICAgICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRvY2tlci5pbWFnZS5yb290ZnMuZGlmZi50YXIuZ3ppcCIsCiAgICAgICJzaXplIjogMjQ3OSwKICAgICAgImRpZ2VzdCI6ICJzaGEyNTY6MmRiMjk3MTAxMjNlM2U1M2E3OTRmMjY5NDA5NGI5YjQzMzhhYTllZTVjNDBiOTMwY2I4MDYzYTFiZTM5MmM1NCIKICAgIH0KICBdCn0K"
} Note: verbose mode can be combined with the raw mode. In that scenario, the output JSON has no indents. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently the ORAS CLI does not support manifest commands.
Docker has an inspect command and so does crane. These cannot be used to view all types of manifests or ORAS manifest. I would be beneficial if the oras CLI could support retrieving manifest of types it is aware of or even types that can be specified on the CLI.
Here is a candidate specification for the ORAS CLI. This however has be translated into the underlying library so that frameworks like notary and ratify can use this capability to fetch the manifest.
Fetch a Manifest
Command returns a docker manifest, manifestlist , OCI manifest, index or ORAS Artifact which are the common types of manifest already available.
Fetch by digest
Fetch raw manifest
This enables digest computation
Fetch platform manifest
This enables the client to request a manifest for a given platform by
os/arch/variant
Fetch with headers
Output the raw headers to stderr so that debugging the request is easier. I think we can mask out the authorization to avoid exposing credentials and if there is an ask to show the auth header then include a like --expose-credentials. But would keep that out of scope for now.
Usage
Beta Was this translation helpful? Give feedback.
All reactions