Skip to content

Commit

Permalink
Fix: cmd rmi images with flags
Browse files Browse the repository at this point in the history
Signed-off-by: tgfree <[email protected]>

Fix: cmd rmi images with flags

Signed-off-by: tgfree <[email protected]>
  • Loading branch information
tgfree7 committed Sep 16, 2022
1 parent cd61b99 commit de9ab40
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions cmd/sealer/cmd/image/rmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,27 @@ import (

var removeOpts *options.RemoveImageOptions

var exampleForRmiCmd = `sealer rmi {imageName or imageID} ...
remove all images:
sealer rmi --all/-a
prune dangling images:
sealer rmi --prune/-p
force removal of the image and any containers using the image:
sealer rmi {imageName or imageID} --force/-f
`

// NewRmiCmd rmiCmd represents the rmi command
func NewRmiCmd() *cobra.Command {
rmiCmd := &cobra.Command{
Use: "rmi",
Short: "remove local images by name",
Short: "remove local images",
// TODO: add long description.
Long: "",
Example: `sealer rmi registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.19.8`,
Args: cobra.MinimumNArgs(1),
Example: exampleForRmiCmd,
RunE: func(cmd *cobra.Command, args []string) error {
return runRemove(args)
},
Expand Down

0 comments on commit de9ab40

Please sign in to comment.