Skip to content

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

Closed

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.

Activity

  1. added
    enhancement
    on Mar 28, 2023
  2. added this to the future milestone on Mar 28, 2023
  3. added
    good first issue
    on Mar 28, 2023
  4. TerryHowe commented on Mar 28, 2023

    @TerryHowe
    Member

    How about just call it digest instead of as an alias?

  5. qweeah commented on Mar 28, 2023

    @qweeah
    ContributorAuthor

    To me, resolve is a verb and aligns more to current command naming convention.

  6. shizhMSFT commented on Mar 28, 2023

    @shizhMSFT
    Contributor

    To me, resolve is a verb and aligns more to current command naming convention.

    The last command should be a verb so that it sounds like a nature language. Say... oras resolve <something>.

  7. shizhMSFT commented on Mar 28, 2023

    @shizhMSFT
    Contributor

    In general, oras <command> <reference> follows subject-verb-object word order where oras is the subject, <command> is the verb and <reference> is the object.

  8. rafiya2003 commented on Jun 1, 2023

    @rafiya2003

    I would like to work on this, frankly I don't know much but I will learn and do. I am a newbie(first year UG student). I want to learn and grow. please give me the opportunity to learn and experience

  9. qweeah commented on Jun 5, 2023

    @qweeah
    ContributorAuthor

    @rafiya2003 This issue requires knowledge on

  10. rafiya2003 commented on Jun 6, 2023

    @rafiya2003

    @qweeah can you plz suggest me some issues

  11. qweeah commented on Jun 7, 2023

    @qweeah
    ContributorAuthor

    @rafiya2003 #742 is similar to this but much simpler.

  12. sajayantony commented on Jun 7, 2023

    @sajayantony
    Contributor

    Would be interesting if we can support format parameter as well for formats that are used in other places like . {{.Registry}}/{{.Repository}}:{{.Tag}}@{{.Digest}}

  13. iambahmanop commented on Jul 8, 2023

    @iambahmanop
    Contributor

    I am up for taking this item.

  14. added
    ux
    on Jul 18, 2023
  15. modified the milestones: future, v1.2.0 on Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issueux

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions