mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
37 lines
841 B
Go
37 lines
841 B
Go
|
package image
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/spf13/cobra"
|
||
|
|
||
|
"github.com/docker/docker/cli"
|
||
|
"github.com/docker/docker/cli/command"
|
||
|
)
|
||
|
|
||
|
// NewImageCommand returns a cobra command for `image` subcommands
|
||
|
func NewImageCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||
|
cmd := &cobra.Command{
|
||
|
Use: "image",
|
||
|
Short: "Manage Docker images",
|
||
|
Args: cli.NoArgs,
|
||
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
|
||
|
},
|
||
|
}
|
||
|
cmd.AddCommand(
|
||
|
NewBuildCommand(dockerCli),
|
||
|
NewHistoryCommand(dockerCli),
|
||
|
NewImportCommand(dockerCli),
|
||
|
NewLoadCommand(dockerCli),
|
||
|
NewPullCommand(dockerCli),
|
||
|
NewPushCommand(dockerCli),
|
||
|
NewSaveCommand(dockerCli),
|
||
|
NewTagCommand(dockerCli),
|
||
|
newListCommand(dockerCli),
|
||
|
newRemoveCommand(dockerCli),
|
||
|
newInspectCommand(dockerCli),
|
||
|
)
|
||
|
return cmd
|
||
|
}
|