Skip to content

Commit

Permalink
doc: add example for attach with custom layer media type (oras-projec…
Browse files Browse the repository at this point in the history
…t#1195)

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Feynman Zhou <feynmanzhou@microsoft.com>
  • Loading branch information
qweeah authored and FeynmanZhou committed May 11, 2024
1 parent e1b28f4 commit 3fd00bd
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_media_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 3fd00bd

Please sign in to comment.