Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cdi = &cli.Command{ Name: "cdi", Usage: "[unimplemented] manage opencdi stack", Action: unimplemented, Hidden: true, }
View Source
var Config = &cli.Command{ Name: "config", Usage: "[unimplemented] manage running configuration", Action: unimplemented, Hidden: true, }
View Source
var Copy = &cli.Command{ Name: "copy", Usage: "[unimplemented] copy resources between host and containers", Description: "copy resources between host and containers, or between containers", Action: unimplemented, Hidden: true, }
View Source
var Images = &cli.Command{ Name: "images", Usage: "list and filter images with fuzzy name matching", Description: "list and filter images with fuzzy name matching", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "with-id", Aliases: []string{"id"}, Value: false, }, }, Action: func(cli *cli.Context) error { var filter string if cli.NArg() == 0 { filter = "." } else { filter = cli.Args().Get(0) } return Platform.ImageList(cli.Bool("with-id"), filter) }, }
View Source
var List = &cli.Command{ Name: "list", Usage: "list and filter containers with fuzzy name matching", Description: "list and filter containers with fuzzy name matching", Action: func(cli *cli.Context) error { var filter string if cli.NArg() == 0 { filter = "." } else { filter = cli.Args().Get(0) } return Platform.ContainerList( cli.Bool("all"), cli.Bool("with-id"), filter, ) }, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "all", Aliases: []string{"a"}, Usage: "list all containers", Value: false, }, &cli.BoolFlag{ Name: "with-id", Aliases: []string{"id"}, Usage: "show id with the list", Value: false, }, }, }
View Source
var Platform = functions.NewProvider("docker")
View Source
var Run = &cli.Command{ Name: "run", Usage: "run a container with the specified image", Action: func(cli *cli.Context) error { if cli.NArg() == 0 { return errors.New(cli.App.Name + " run needs image name") } else { cmd := cli.Args().Slice()[1:] if len(cmd) == 0 { cmd = []string{"/bin/sh"} } return Platform.ContainerRun( cli.Args().Get(0), cli.Bool("persistent"), cmd, ) } }, ArgsUsage: "<image> [command] [args...]", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "persistent", Aliases: []string{"P"}, Usage: "make a non-temporary container", Value: false, }, &cli.StringFlag{ Name: "v", Usage: "[disabled] specify the `volume:path` to attach to the container", Hidden: true, }, &cli.StringFlag{ Name: "device", Usage: "[disabled] specify device `path` to attach to the container", Hidden: true, }, }, }
View Source
var Stop = &cli.Command{ Name: "stop", Usage: "stop containers with fuzzy name matching", Description: "stop containers with fuzzy name matching", Action: func(cli *cli.Context) error { if cli.NArg() == 0 { return errors.New("no arg") } else { args := cli.Args().Slice() for i := range args { if err := Platform.ContainerStop(args[i]); err != nil { return err } } return nil } }, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "all", }, }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.