()
| 31 | ) |
| 32 | |
| 33 | func 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 |
| 60 | func createOptions(cmd *cobra.Command) (types.ContainerCreateOptions, error) { |
no test coverage detected
searching dependent graphs…