MCPcopy Create free account
hub / github.com/containerd/nerdctl / RemoveCommand

Function RemoveCommand

cmd/nerdctl/container/container_remove.go:29–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27)
28
29func RemoveCommand() *cobra.Command {
30 var cmd = &cobra.Command{
31 Use: "rm [flags] CONTAINER [CONTAINER, ...]",
32 Args: cobra.MinimumNArgs(1),
33 Short: "Remove one or more containers",
34 RunE: removeAction,
35 ValidArgsFunction: rmShellComplete,
36 SilenceUsage: true,
37 SilenceErrors: true,
38 }
39 cmd.Aliases = []string{"remove"}
40 cmd.Flags().BoolP("force", "f", false, "Force the removal of a running|paused|unknown container (uses SIGKILL)")
41 cmd.Flags().BoolP("volumes", "v", false, "Remove volumes associated with the container")
42 return cmd
43}
44
45func removeAction(cmd *cobra.Command, args []string) error {
46 globalOptions, err := helpers.ProcessRootCmdFlags(cmd)

Callers 2

newAppFunction · 0.92
CommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…