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

Function CreateCommand

cmd/nerdctl/container/container_create.go:33–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31)
32
33func CreateCommand() *cobra.Command {
34 shortHelp := "Create a new container. Optionally specify \"ipfs://\" or \"ipns://\" scheme to pull image from IPFS."
35 longHelp := shortHelp
36 switch runtime.GOOS {
37 case "windows":
38 longHelp += "\n"
39 longHelp += "WARNING: `nerdctl create` is experimental on Windows and currently broken (https://github.com/containerd/nerdctl/issues/28)"
40 case "freebsd":
41 longHelp += "\n"
42 longHelp += "WARNING: `nerdctl create` is experimental on FreeBSD and currently requires `--net=none` (https://github.com/containerd/nerdctl/blob/main/docs/freebsd.md)"
43 }
44 var cmd = &cobra.Command{
45 Use: "create [flags] IMAGE [COMMAND] [ARG...]",
46 Args: cobra.MinimumNArgs(1),
47 Short: shortHelp,
48 Long: longHelp,
49 RunE: createAction,
50 ValidArgsFunction: runShellComplete,
51 SilenceUsage: true,
52 SilenceErrors: true,
53 }
54 cmd.Flags().SetInterspersed(false)
55 setCreateFlags(cmd)
56 return cmd
57}
58
59//revive:disable:function-length
60func createOptions(cmd *cobra.Command) (types.ContainerCreateOptions, error) {

Callers 2

newAppFunction · 0.92
CommandFunction · 0.85

Calls 1

setCreateFlagsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…