summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-06-13 07:40:41 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-13 14:30:45 +0000
commit65033b586fb353734d29dac1dfb9f342d5eeaa21 (patch)
tree1713e18f2b1a02d2accb8d5464fe857f67843307 /cmd
parentbe217caa3856c76a6b997c203422715e13b0335a (diff)
downloadpodman-65033b586fb353734d29dac1dfb9f342d5eeaa21.tar.gz
podman-65033b586fb353734d29dac1dfb9f342d5eeaa21.tar.bz2
podman-65033b586fb353734d29dac1dfb9f342d5eeaa21.zip
add podman container and image command
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #941 Approved by: TomSweeneyRedHat
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/container.go45
-rw-r--r--cmd/podman/image.go32
-rw-r--r--cmd/podman/images.go9
-rw-r--r--cmd/podman/main.go2
-rw-r--r--cmd/podman/ps.go9
-rw-r--r--cmd/podman/rmi.go9
6 files changed, 106 insertions, 0 deletions
diff --git a/cmd/podman/container.go b/cmd/podman/container.go
new file mode 100644
index 000000000..c8ad8e04d
--- /dev/null
+++ b/cmd/podman/container.go
@@ -0,0 +1,45 @@
+package main
+
+import (
+ "github.com/urfave/cli"
+)
+
+var (
+ subCommands = []cli.Command{
+ attachCommand,
+ commitCommand,
+ createCommand,
+ diffCommand,
+ execCommand,
+ exportCommand,
+ inspectCommand,
+ killCommand,
+ logsCommand,
+ lsCommand,
+ mountCommand,
+ pauseCommand,
+ portCommand,
+ // pruneCommand,
+ restartCommand,
+ rmCommand,
+ runCommand,
+ startCommand,
+ statsCommand,
+ stopCommand,
+ topCommand,
+ umountCommand,
+ unpauseCommand,
+ // updateCommand,
+ waitCommand,
+ }
+
+ containerDescription = "Manage containers"
+ containerCommand = cli.Command{
+ Name: "container",
+ Usage: "container COMMAND",
+ Description: containerDescription,
+ ArgsUsage: "",
+ Subcommands: subCommands,
+ UseShortOptionHandling: true,
+ }
+)
diff --git a/cmd/podman/image.go b/cmd/podman/image.go
new file mode 100644
index 000000000..5deea5c74
--- /dev/null
+++ b/cmd/podman/image.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+ "github.com/urfave/cli"
+)
+
+var (
+ imageSubCommands = []cli.Command{
+ buildCommand,
+ historyCommand,
+ importCommand,
+ inspectCommand,
+ loadCommand,
+ lsImagesCommand,
+ // pruneCommand,
+ pullCommand,
+ pushCommand,
+ rmImageCommand,
+ saveCommand,
+ tagCommand,
+ }
+
+ imageDescription = "Manage images"
+ imageCommand = cli.Command{
+ Name: "image",
+ Usage: "image COMMAND",
+ Description: imageDescription,
+ ArgsUsage: "",
+ Subcommands: imageSubCommands,
+ UseShortOptionHandling: true,
+ }
+)
diff --git a/cmd/podman/images.go b/cmd/podman/images.go
index 918015937..a54620c72 100644
--- a/cmd/podman/images.go
+++ b/cmd/podman/images.go
@@ -93,6 +93,15 @@ var (
ArgsUsage: "",
UseShortOptionHandling: true,
}
+ lsImagesCommand = cli.Command{
+ Name: "ls",
+ Usage: "list images in local storage",
+ Description: imagesDescription,
+ Flags: imagesFlags,
+ Action: imagesCmd,
+ ArgsUsage: "",
+ UseShortOptionHandling: true,
+ }
)
func imagesCmd(c *cli.Context) error {
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index 8edecffb3..56e724098 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -39,12 +39,14 @@ func main() {
app.Commands = []cli.Command{
attachCommand,
commitCommand,
+ containerCommand,
buildCommand,
createCommand,
diffCommand,
execCommand,
exportCommand,
historyCommand,
+ imageCommand,
imagesCommand,
importCommand,
infoCommand,
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index 4ca9b13a3..ca20f3f33 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -128,6 +128,15 @@ var (
ArgsUsage: "",
UseShortOptionHandling: true,
}
+ lsCommand = cli.Command{
+ Name: "ls",
+ Usage: "List containers",
+ Description: psDescription,
+ Flags: psFlags,
+ Action: psCmd,
+ ArgsUsage: "",
+ UseShortOptionHandling: true,
+ }
)
func psCmd(c *cli.Context) error {
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go
index 796ec2a3d..f3e1a8e36 100644
--- a/cmd/podman/rmi.go
+++ b/cmd/podman/rmi.go
@@ -32,6 +32,15 @@ var (
Flags: rmiFlags,
UseShortOptionHandling: true,
}
+ rmImageCommand = cli.Command{
+ Name: "rm",
+ Usage: "removes one or more images from local storage",
+ Description: rmiDescription,
+ Action: rmiCmd,
+ ArgsUsage: "IMAGE-NAME-OR-ID [...]",
+ Flags: rmiFlags,
+ UseShortOptionHandling: true,
+ }
)
func rmiCmd(c *cli.Context) error {