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

Command to push a manifest to a remote registry #472

Closed
Tracked by #459
qweeah opened this issue Aug 3, 2022 · 4 comments · Fixed by #494
Closed
Tracked by #459

Command to push a manifest to a remote registry #472

qweeah opened this issue Aug 3, 2022 · 4 comments · Fixed by #494
Assignees
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Aug 3, 2022

User can use this command to push a manifest with any media type to a target registry.

The proposed commands is:

Usage:
  oras manifest push REG/REPO<:TAG|@DIGEST> PATH [flags]

Flags:
  --ca-file string               server certificate authority file for the remote registry
  -d, --debug                    debug mode
  -h, --help                     help for pushing a manifest
      --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

User need to make sure that successor nodes in the manifest are already pushed to the registry.

Related to #459

@yuehaoliang
Copy link
Contributor

yuehaoliang commented Aug 9, 2022

Hi team, I'm interested in resolving both this issue and #473.

@yuehaoliang
Copy link
Contributor

yuehaoliang commented Aug 16, 2022

May need suggestions for the UX.

ORAS needs to know the media type of the manifest it tries to push, yet the command mentioned above doesn't ask user to provide the media type. We can let ORAS try to parse the provided manifest file, unmarshalling json, to get the media type. However, in the future we may want to support manifests not in OCI or ORAS specs, even manifest as a YAML file. In this case, we may not be able to fetch the media type from the provided file.

Therefore, a suggestion is to add a --media-type flag to allow user to define the media type of the manifest. ORAS will first identify the media type as what is given by the flag, and if the flag is not given, then it tries to fetch it by parsing the provided manifest file. If this flag is not given and media type cannot be unmarshalled from json, it will exit with an error.

@yuehaoliang
Copy link
Contributor

yuehaoliang commented Aug 16, 2022

In addition, the ORAS client side will not check whether the manifest file provided by user is valid or supported, the checking will be done by the server (distribution/registry). If users try to push manifest with a wrong file, the server will through "invalid manifest" error.

@sajayantony
Copy link
Contributor

Sounds good. If the flag is not passed then inferring the mediaType from the manifest makes sense since the OCI spec does specify that the manifest SHOULD have a mediaType.

Also requiring the user to pass this flag in makes it harder for tools to maybe download a manifest edit and upload it since they need to now also extract and pass an additional argument.

For e.g.

oras manifest pull myregistry.io/myimage:v1 ...
vim manifest.json ...
oras manifest push myregistry.io/myimage:v1

Repository owner moved this from Todo to Done in ORAS-Planning Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants