Skip to content

add command to get the digest of a tagged manifest without parsing output #907

@qweeah

Description

@qweeah

What is the version of your ORAS CLI

1.0.0

What would you like to be added?

Add a new command to get the digest of a tagged manifest as below:

$ oras resolve -h
Resolves digest of the target artifact

Usage:
  oras resolve [flags] <name>:<tag>

Aliases:
  digest

Flags:
      --ca-file string                              server certificate authority file for the remote registry
  -d, --debug                                       debug mode
      --descriptor                                  output a descriptor of the artifact
      --full-ref                                    print the full artifact reference with digest
  -H, --header stringArray                          add custom headers to requests
  -h, --help                                        help for resolve
      --insecure                                    allow connections to SSL registry without certs
      --media-type strings                          accepted media types
      --oci-layout                                  set target as an OCI image layout
  -p, --password string                             registry password or identity token
      --password-stdin                              read password or identity token from stdin
      --plain-http                                  allow insecure connections to registry without SSL check
      --platform os[/arch][/variant][:os_version]   request platform in the form of os[/arch][/variant][:os_version]
      --pretty                                      prettify JSON objects printed to stdout
      --registry-config path                        path of the authentication file for registry
      --resolve host:port:address[:address_port]    customized DNS for registry, formatted in host:port:address[:address_port]
  -u, --username string                             registry username
  -v, --verbose                                     verbose output

Examples

  • Resolve digest of docker.io/library/hello-world:latest
$ oras resolve docker.io/library/hello-world:latest
sha256:ffb13da98453e0f04d33a6eee5bb8e46ee50d08ebe17735fc0779d0349e889e9
  • Resolve full reference of docker.io/library/hello-world:latest with digest
$ oras resolve docker.io/library/hello-world:latest --full-ref
docker.io/library/hello-world@sha256:ffb13da98453e0f04d33a6eee5bb8e46ee50d08ebe17735fc0779d0349e889e9

Why is this needed for ORAS?

This will increase the usability of oras in CI/CD jobs.

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

  • Yes, I am willing to implement it.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgood first issueGood for newcomersuxUser experience related

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions