Skip to content

Commit

Permalink
doc: add example for attach with custom layer media type
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Nov 29, 2023
1 parent 72b48e4 commit d85b256
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/oras/root/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ type attachOptions struct {
func attachCmd() *cobra.Command {
var opts attachOptions
cmd := &cobra.Command{
Use: "attach [flags] --artifact-type=<type> <name>{:<tag>|@<digest>} <file>[:<type>] [...]",
Use: "attach [flags] --artifact-type=<type> <name>{:<tag>|@<digest>} <file>[:<layer_type>] [...]",
Short: "[Preview] Attach files to an existing artifact",
Long: `[Preview] Attach files to an existing artifact
** This command is in preview and under development. **
Example - Attach file 'hi.txt' with type 'doc/example' to manifest 'hello:v1' in registry 'localhost:5000':
Example - Attach file 'hi.txt' with aritifact type 'doc/example' to manifest 'hello:v1' in registry 'localhost:5000':
oras attach --artifact-type doc/example localhost:5000/hello:v1 hi.txt
Example - Push file "hi.txt" with the custom layer media type 'application/vnd.me.hi':
oras attach --artifact-type doc/example localhost:5000/hello:v1 hi.txt:application/vnd.me.hi
Example - Attach file "hi.txt" using a specific method for the Referrers API:
oras attach --artifact-type doc/example --distribution-spec v1.1-referrers-api localhost:5000/hello:v1 hi.txt # via API
oras attach --artifact-type doc/example --distribution-spec v1.1-referrers-tag localhost:5000/hello:v1 hi.txt # via tag scheme
Expand Down

0 comments on commit d85b256

Please sign in to comment.