oras icon indicating copy to clipboard operation
oras copied to clipboard

Command to list repositories in a remote registry

Open qweeah opened this issue 2 years ago • 1 comments

The proposed command is:

Usage:
  oras repository list REGISTRY [flags]

Flags:
  --ca-file string           server certificate authority file for the remote registry
  -d, --debug                    debug mode
  -h, --help                     help for list
      --insecure                 allow connections to SSL registry without certs
  -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
  -u, --username string          registry username
  -v, --verbose                  verbose output

The output should be a list of repositories with one name per line.

Related to #459

qweeah avatar Aug 03 '22 02:08 qweeah

I am interest in this, please assign this issue to me

junczhu avatar Aug 09 '22 03:08 junczhu

Since other targets don't have repositories maybe cranes approach of calling it catalog makes more sense to me since it also matches with the API. Also are there any other commands under the repository group? If there are then repository list makes sense.

sajayantony avatar Aug 19 '22 22:08 sajayantony

@sajayantony

Since other targets don't have repositories maybe cranes approach of calling it catalog makes more sense to me since it also matches with the API

I see repository is more common than catalog on the registry side like DockerHub, ACR, ECR, etc. so I vote for naming repository here.

Also are there any other commands under the repository group?

There will be another command list-tags under the repository group.

@qweeah @junczhuMSFT Let me give a detailed example for this CLI UX:

$ oras repository list samplecr.cncf.io
acr/hello-world
library/alpine
net-monitor
sample/hello-world

Shall we provide an alias -l for list in this command?

FeynmanZhou avatar Aug 23 '22 16:08 FeynmanZhou

@sajayantony

Since other targets don't have repositories maybe cranes approach of calling it catalog makes more sense to me since it also matches with the API

I see repository is more common than catalog on the registry side like DockerHub, ACR, ECR, etc. so I vote for naming repository here.

Also are there any other commands under the repository group?

There will be another command list-tags under the repository group.

@qweeah @junczhuMSFT Let me give a detailed example for this CLI UX:

$ oras repository list samplecr.cncf.io
acr/hello-world
library/alpine
net-monitor
sample/hello-world

Shall we provide an alias -l for list in this command?

provided an alias -l for list in the latest #525

junczhu avatar Aug 26 '22 05:08 junczhu

Shall we provide "first" and "skip" flags? @FeynmanZhou There is an azure cli feature, for example, users can skip the first 3,000 records and return the first 1,000 records after those records skipped.

LINK

/cc @sajayantony @shizhMSFT @qweeah

junczhu avatar Aug 26 '22 05:08 junczhu

@junczhuMSFT IF --first and --skip are provided, will oras fetch the skipped records? e.g. oras repository list some.oci.distro --first 100 --skip 300, at least 400 records will be fetched right?

If so, I don't think they need to be added to oras, user can use oras to fetch all the repositories and use tail and head to chop out the records needed.

qweeah avatar Aug 26 '22 08:08 qweeah

@junczhuMSFT Instead, you may think about last and n according to the Docker Registry V2 API. Related functionalities are also supported by oras-go.

shizhMSFT avatar Aug 26 '22 15:08 shizhMSFT

For your information, here is the output sample of this command:

image

/cc @FeynmanZhou

junczhu avatar Sep 06 '22 08:09 junczhu