From d85b256ca816519460329f8052a587b2378edba9 Mon Sep 17 00:00:00 2001 From: Billy Zha Date: Wed, 29 Nov 2023 08:24:08 +0000 Subject: [PATCH] doc: add example for attach with custom layer media type Signed-off-by: Billy Zha --- cmd/oras/root/attach.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/oras/root/attach.go b/cmd/oras/root/attach.go index f234d549f..6ab4e0147 100644 --- a/cmd/oras/root/attach.go +++ b/cmd/oras/root/attach.go @@ -45,15 +45,18 @@ type attachOptions struct { func attachCmd() *cobra.Command { var opts attachOptions cmd := &cobra.Command{ - Use: "attach [flags] --artifact-type= {:|@} [:] [...]", + Use: "attach [flags] --artifact-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