diff --git a/cmd/skopeo/copy.go b/cmd/skopeo/copy.go index d6e89456..cbee3c00 100644 --- a/cmd/skopeo/copy.go +++ b/cmd/skopeo/copy.go @@ -4,8 +4,10 @@ import ( "errors" "fmt" "os" + "strings" "github.com/containers/image/copy" + "github.com/containers/image/transports" "github.com/containers/image/transports/alltransports" "github.com/containers/image/types" "github.com/urfave/cli" @@ -63,8 +65,17 @@ func copyHandler(context *cli.Context) error { } var copyCmd = cli.Command{ - Name: "copy", - Usage: "Copy an image from one location to another", + Name: "copy", + Usage: "Copy an IMAGE-NAME from one location to another", + Description: fmt.Sprintf(` + + Container "IMAGE-NAME" uses a "transport":"details" format. + + Supported transports: + %s + + See skopeo(1) section "IMAGE NAMES" for the expected format + `, strings.Join(transports.ListNames(), ", ")), ArgsUsage: "SOURCE-IMAGE DESTINATION-IMAGE", Action: copyHandler, // FIXME: Do we need to namespace the GPG aspect? diff --git a/cmd/skopeo/delete.go b/cmd/skopeo/delete.go index 4b00cc6a..99018bd5 100644 --- a/cmd/skopeo/delete.go +++ b/cmd/skopeo/delete.go @@ -3,7 +3,9 @@ package main import ( "errors" "fmt" + "strings" + "github.com/containers/image/transports" "github.com/containers/image/transports/alltransports" "github.com/urfave/cli" ) @@ -29,8 +31,16 @@ func deleteHandler(context *cli.Context) error { } var deleteCmd = cli.Command{ - Name: "delete", - Usage: "Delete image IMAGE-NAME", + Name: "delete", + Usage: "Delete image IMAGE-NAME", + Description: fmt.Sprintf(` + Delete an "IMAGE_NAME" from a transport + + Supported transports: + %s + + See skopeo(1) section "IMAGE NAMES" for the expected format + `, strings.Join(transports.ListNames(), ", ")), ArgsUsage: "IMAGE-NAME", Action: deleteHandler, Flags: []cli.Flag{ diff --git a/cmd/skopeo/inspect.go b/cmd/skopeo/inspect.go index f3b8db6a..2e028c63 100644 --- a/cmd/skopeo/inspect.go +++ b/cmd/skopeo/inspect.go @@ -9,6 +9,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/containers/image/docker" "github.com/containers/image/manifest" + "github.com/containers/image/transports" "github.com/opencontainers/go-digest" "github.com/pkg/errors" "github.com/urfave/cli" @@ -29,8 +30,16 @@ type inspectOutput struct { } var inspectCmd = cli.Command{ - Name: "inspect", - Usage: "Inspect image IMAGE-NAME", + Name: "inspect", + Usage: "Inspect image IMAGE-NAME", + Description: fmt.Sprintf(` + Return low-level information about "IMAGE-NAME" in a registry/transport + + Supported transports: + %s + + See skopeo(1) section "IMAGE NAMES" for the expected format + `, strings.Join(transports.ListNames(), ", ")), ArgsUsage: "IMAGE-NAME", Flags: []cli.Flag{ cli.StringFlag{ diff --git a/docs/skopeo.1.md b/docs/skopeo.1.md index 1b762c95..8b8bd50e 100644 --- a/docs/skopeo.1.md +++ b/docs/skopeo.1.md @@ -12,26 +12,29 @@ It also allows you to copy container images between various registries, possibly ## IMAGE NAMES Most commands refer to container images, using a _transport_`:`_details_ format. The following formats are supported: - **atomic:**_namespace_**/**_stream_**:**_tag_ - An image in the current project of the current default Atomic - Registry. The current project and Atomic Registry instance are by - default read from `$HOME/.kube/config`, which is set e.g. using - `(oc login)`. + **atomic:**_hostname_**/**_namespace_**/**_stream_**:**_tag_ + An image served by an OpenShift(Atomic) Registry server. The current OpenShift project and OpenShift Registry instance are by default read from `$HOME/.kube/config`, which is set e.g. using `(oc login)`. + + **containers-storage://**_docker-reference_ + An image located in a local containers/storage image store. Location and image store specified in /etc/containers/storage.conf **dir:**_path_ - An existing local directory _path_ storing the manifest, layer - tarballs and signatures as individual files. This is a - non-standardized format, primarily useful for debugging or - noninvasive container inspection. + An existing local directory _path_ storing the manifest, layer tarballs and signatures as individual files. This is a non-standardized format, primarily useful for debugging or noninvasive container inspection. **docker://**_docker-reference_ - An image in a registry implementing the "Docker Registry HTTP API V2". - By default, uses the authorization state in `$HOME/.docker/config.json`, - which is set e.g. using `(docker login)`. + An image in a registry implementing the "Docker Registry HTTP API V2". By default, uses the authorization state in `$HOME/.docker/config.json`, which is set e.g. using `(docker login)`. + + **docker-archive:**_path_[**:**_docker-reference_] + An image is stored in the `docker save` formated file. _docker-reference_ is only used when creating such a file, and it must not contain a digest. + + **docker-daemon:**_docker-reference_ + An image _docker-reference_ stored in the docker daemon internal storage. _docker-reference_ must contain either a tag or a digest. Alternatively, when reading images, the format can also be docker-daemon:algo:digest (an image ID). **oci:**_path_**:**_tag_ - An image _tag_ in a directory compliant with "Open Container Image - Layout Specification" at _path_. + An image _tag_ in a directory compliant with "Open Container Image Layout Specification" at _path_. + + **ostree:**_image_[**@**_/absolute/repo/path_] + An image in local OSTree repository. _/absolute/repo/path_ defaults to _/ostree/repo_. # OPTIONS