Command to push a blob to a remote registry
The proposed commands is:
Usage:
oras blob push REG/REPO@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 blob
--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
-o, --output string save the fetched blob to
Related to #459
please assign this to me
Current UX:
oras blob push localhost:5000/0817hello artifact.txt

cc @shizhMSFT @yizha1 @FeynmanZhou
One minor comment:
- Push a blob to
aremote registry
Some questions:
- Can we change the mediaType for the blob?
- What is the supported maximum size of a blob? What will happen if the blob size exceeds the maximum value?
- Can we cancel pushing a blob? What will happen if I
ctrl+cwhile pushing a large blob?
Hi @yizha1,
- Push a blob to
aremote registry
Thanks for pointing out, I will change the command message to Push a blob to a remote registry 👌
Can we change the mediaType for the blob?
I'd say no. The blob only has one mediaType application/octet-stream, ref: https://docs.docker.com/registry/spec/api/#initiate-blob-upload
What is the supported maximum size of a blob? What will happen if the blob size exceeds the maximum value?
Currently we do not have a maximum limit on the size of a blob from our ORAS side. But a registry should have some limit on the maximum blob size that it can accept. So if the blob size exceeds the maximum value, the error will be returned from registry side.
Can we cancel pushing a blob? What will happen if I ctrl+c while pushing a large blob?
Yes, we can cancel pushing a blob by using ctrl+c. If the push operation has not been completely finished yet, then the process will be stopped.
The overall UX of oras push looks intuitive to me. Would it be more exact to update <name> to <registry>?

I think it would be helpful to output the full descriptor to a file. without that how is the user planning to use this ? /cc @shizhMSFT
We can however merge #489 but not close this issue if we want to enhance the output of open an another issue. But either way I think we need to be able to describe the use case here /cc @FeynmanZhou @yizha1
@qweeah We need to unify the UX across all command sets like oras manifest and oras blob as they all do CRUD. Let's discuss it.
The overall UX of
oras pushlooks intuitive to me. Would it be more exact to update<name>to<registry>?
That's a good idea! But I notice we are now only using registry in login and logout commands, and name for others (such as oras push). We might need to unify the UX across all commands first.

UX design (08/26/2022)
# stdout human readable messages
oras blob push <name> <path>
# stdout json descriptor
oras blob push <name> <path> --descriptor
# stdout prettified json descriptor
oras blob push <name> <path> --descriptor --pretty
# read from stdin, then push to <name> registry. stdout human readable messages
# return error if --password-stdin flag is used at the same time
oras blob push <name> -
help doc
