diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-06-13 07:40:41 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-13 14:30:45 +0000 |
commit | 65033b586fb353734d29dac1dfb9f342d5eeaa21 (patch) | |
tree | 1713e18f2b1a02d2accb8d5464fe857f67843307 | |
parent | be217caa3856c76a6b997c203422715e13b0335a (diff) | |
download | podman-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
-rw-r--r-- | cmd/podman/container.go | 45 | ||||
-rw-r--r-- | cmd/podman/image.go | 32 | ||||
-rw-r--r-- | cmd/podman/images.go | 9 | ||||
-rw-r--r-- | cmd/podman/main.go | 2 | ||||
-rw-r--r-- | cmd/podman/ps.go | 9 | ||||
-rw-r--r-- | cmd/podman/rmi.go | 9 | ||||
-rw-r--r-- | commands.md | 2 | ||||
-rw-r--r-- | completions/bash/podman | 229 | ||||
-rw-r--r-- | docs/podman-container.1.md | 42 | ||||
-rw-r--r-- | docs/podman-image.1.md | 29 | ||||
-rw-r--r-- | docs/podman.1.md | 2 | ||||
-rw-r--r-- | transfer.md | 6 |
12 files changed, 413 insertions, 3 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 { diff --git a/commands.md b/commands.md index 307679c49..fb319ca49 100644 --- a/commands.md +++ b/commands.md @@ -8,12 +8,14 @@ | [podman-attach(1)](/docs/podman-attach.1.md) | Attach to a running container |[![...](/docs/play.png)](https://asciinema.org/a/XDlocUrHVETFECg4zlO9nBbLf)| | [podman-build(1)](/docs/podman-build.1.md) | Build an image using instructions from Dockerfiles || | [podman-commit(1)](/docs/podman-commit.1.md) | Create new image based on the changed container || +| [podman-container(1)](/docs/podman-container.1.md) | Manage Containers || | [podman-cp(1)](/docs/podman-cp.1.md) | Instead of providing a `podman cp` command, the man page `podman-cp` describes how to use the `podman mount` command to have even more flexibility and functionality|| | [podman-create(1)](/docs/podman-create.1.md) | Create a new container || | [podman-diff(1)](/docs/podman-diff.1.md) | Inspect changes on a container or image's filesystem |[![...](/docs/play.png)](https://asciinema.org/a/FXfWB9CKYFwYM4EfqW3NSZy1G)| | [podman-exec(1)](/docs/podman-exec.1.md) | Execute a command in a running container | [podman-export(1)](/docs/podman-export.1.md) | Export container's filesystem contents as a tar archive |[![...](/docs/play.png)](https://asciinema.org/a/913lBIRAg5hK8asyIhhkQVLtV)| | [podman-history(1)](/docs/podman-history.1.md) | Shows the history of an image |[![...](/docs/play.png)](https://asciinema.org/a/bCvUQJ6DkxInMELZdc5DinNSx)| +| [podman-image(1)](/docs/podman-image.1.md) | Manage Images|| | [podman-images(1)](/docs/podman-images.1.md) | List images in local storage |[![...](/docs/play.png)](https://asciinema.org/a/133649)| | [podman-import(1)](/docs/podman-import.1.md) | Import a tarball and save it as a filesystem image || | [podman-info(1)](/docs/podman-info.1.md) | Display system information |[![...](/docs/play.png)](https://asciinema.org/a/yKbi5fQ89y5TJ8e1RfJd4ivTD)| diff --git a/completions/bash/podman b/completions/bash/podman index a5fd899d8..d28108867 100644 --- a/completions/bash/podman +++ b/completions/bash/podman @@ -666,6 +666,149 @@ _podman_attach() { esac } +_podman_container_attach() { + _podman_attach +} + +_podman_container_commit() { + _podman_commit +} + +_podman_container_create() { + _podman_create +} + +_podman_container_diff() { + _podman_diff +} + +_podman_container_exec() { + _podman_exec +} + +_podman_container_export() { + _podman_export +} + +_podman_container_inspect() { + _podman_inspect +} + +_podman_container_kill() { + _podman_kill +} + +_podman_container_ls() { + _podman_ls +} + +_podman_container_logs() { + _podman_logs +} + +_podman_container_mount() { + _podman_mount +} + +_podman_container_pause() { + _podman_pause +} + +_podman_container_port() { + _podman_port +} + +_podman_container_restart() { + _podman_restart +} + +_podman_container_rm() { + _podman_rm +} + +_podman_container_run() { + _podman_run +} + +_podman_container_start() { + _podman_start +} + +_podman_container_stats() { + _podman_stats +} + +_podman_container_stop() { + _podman_stop +} + +_podman_container_top() { + _podman_top +} + +_podman_container_umount() { + _podman_umount +} + +_podman_container_unmount() { + _podman_unmount +} + +_podman_container_unpause() { + _podman_unpause +} + +_podman_container_wait() { + _podman_wait +} + +_podman_container() { + local boolean_options=" + --help + -h + " + subcommands=" + attach + commit + create + diff + exec + export + inspect + kill + ls + logs + mount + pause + port + restart + rm + run + start + stats + stop + top + umount + unmount + unpause + wait + " + local aliases=" + list + ps + " + __podman_subcommands "$subcommands $aliases" && return + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "--help" -- "$cur" ) ) + ;; + *) + COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) ) + ;; + esac +} + _podman_commit() { local options_with_args=" --author @@ -900,6 +1043,87 @@ _podman_info() { esac } +_podman_image_build() { + _podman_build +} + +_podman_image_history() { + _podman_history +} + +_podman_image_import() { + _podman_import +} + +_podman_image_inspect() { + _podman_inspect +} + +_podman_image_load() { + _podman_load +} + +_podman_image_list() { + _podman_images +} + +_podman_image_ls() { + _podman_images +} + +_podman_image_pull() { + _podman_pull +} + +_podman_image_push() { + _podman_push +} + +_podman_image_rm() { + _podman_rmi +} + +_podman_image_save() { + _podman_save +} + +_podman_image_tag() { + _podman_tag +} + +_podman_image() { + local boolean_options=" + --help + -h + " + subcommands=" + build + history + import + inspect + load + ls + pull + push + rm + save + tag + " + local aliases=" + list + " + __podman_subcommands "$subcommands $aliases" && return + + case "$cur" in + -*) + COMPREPLY=( $( compgen -W "--help" -- "$cur" ) ) + ;; + *) + COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) ) + ;; + esac +} + _podman_images() { local boolean_options=" -a @@ -1609,6 +1833,10 @@ _podman_port() { esac } +_podman_ls() { + _podman_ps +} + _podman_ps() { local options_with_args=" --filter -f @@ -1786,6 +2014,7 @@ _podman_podman() { attach build commit + container create diff exec diff --git a/docs/podman-container.1.md b/docs/podman-container.1.md new file mode 100644 index 000000000..6ac4671ae --- /dev/null +++ b/docs/podman-container.1.md @@ -0,0 +1,42 @@ +% podman-container "1" + +## NAME +podman\-container - Manage containers + +## SYNOPSIS +**podman container SUBCOMMAND [OPTIONS] + +## DESCRIPTION +The container command allows you to manage containers + +## COMMANDS + +| Command | Man Page | Description | +| ------- | ----------------------------------------- | ------------------------------------------------------------------------------ | +| attach | [podman-attach(1)](podman-attach.1.md) | Attach to a running container. | +| commit | [podman-commit(1)](podman-commit.1.md) | Create new image based on the changed container. | +| create | [podman-create(1)](podman-create.1.md) | Create a new container. | +| diff | [podman-diff(1)](podman-diff.1.md) | Inspect changes on a container or image's filesystem. | +| exec | [podman-exec(1)](podman-exec.1.md) | Execute a command in a running container. | +| export | [podman-export(1)](podman-export.1.md) | Export a container's filesystem contents as a tar archive. | +| inspect | [podman-inspect(1)](podman-inspect.1.md) | Display a container or image's configuration. | +| kill | [podman-kill(1)](podman-kill.1.md) | Kill the main process in one or more containers. | +| logs | [podman-logs(1)](podman-logs.1.md) | Display the logs of a container. | +| ls | [podman-ps(1)](podman-ps.1.md) | Prints out information about containers. | +| mount | [podman-mount(1)](podman-mount.1.md) | Mount a working container's root filesystem. | +| pause | [podman-pause(1)](podman-pause.1.md) | Pause one or more containers. | +| port | [podman-port(1)](podman-port.1.md) | List port mappings for the container. | +| restart | [podman-restart(1)](podman-restart.1.md) | Restart one or more containers. | +| rm | [podman-rm(1)](podman-rm.1.md) | Remove one or more containers. | +| run | [podman-run(1)](podman-run.1.md) | Run a command in a container. | +| start | [podman-start(1)](podman-start.1.md) | Starts one or more containers. | +| stats | [podman-stats(1)](podman-stats.1.md) | Display a live stream of one or more container's resource usage statistics. | +| stop | [podman-stop(1)](podman-stop.1.md) | Stop one or more running containers. | +| top | [podman-top(1)](podman-top.1.md) | Display the running processes of a container. | +| umount | [podman-umount(1)](podman-umount.1.md) | Unmount a working container's root filesystem. | +| unmount | [podman-umount(1)](podman-umount.1.md) | Unmount a working container's root filesystem. | +| unpause | [podman-unpause(1)](podman-unpause.1.md) | Unpause one or more containers. | +| wait | [podman-wait(1)](podman-wait.1.md) | Wait on one or more containers to stop and print their exit codes. | + +## SEE ALSO +podman, podman-exec, podman-run diff --git a/docs/podman-image.1.md b/docs/podman-image.1.md new file mode 100644 index 000000000..d48e2ca83 --- /dev/null +++ b/docs/podman-image.1.md @@ -0,0 +1,29 @@ +% podman-image "1" + +## NAME +podman\-image - Manage images + +## SYNOPSIS +**podman image SUBCOMMAND [OPTIONS] + +## DESCRIPTION +The image command allows you to manage images + +## COMMANDS + +| Command | Man Page | Description | +| -------- | ----------------------------------------- | ------------------------------------------------------------------------------ | +| build | [podman-build(1)](podman-build.1.md) | Build a container using a Dockerfile. | +| history | [podman-history(1)](podman-history.1.md) | Show the history of an image. | +| import | [podman-import(1)](podman-import.1.md) | Import a tarball and save it as a filesystem image. | +| inspect | [podman-inspect(1)](podman-inspect.1.md) | Display a image or image's configuration. | +| load | [podman-load(1)](podman-load.1.md) | Load an image from the docker archive. | +| ls | [podman-images(1)](podman-images.1.md) | Prints out information about images. | +| pull | [podman-pull(1)](podman-pull.1.md) | Pull an image from a registry. | +| push | [podman-push(1)](podman-push.1.md) | Push an image from local storage to elsewhere. | +| rm | [podman-rm(1)](podman-rmi.1.md) | Removes one or more locally stored images. | +| save | [podman-save(1)](podman-save.1.md) | Save an image to docker-archive or oci. | +| tag | [podman-tag(1)](podman-tag.1.md) | Add an additional name to a local image. | + +## SEE ALSO +podman diff --git a/docs/podman.1.md b/docs/podman.1.md index d19dd6060..437d72d32 100644 --- a/docs/podman.1.md +++ b/docs/podman.1.md @@ -59,12 +59,14 @@ has the capability to debug pods/images created by crio. | [podman-attach(1)](podman-attach.1.md) | Attach to a running container. | | [podman-build(1)](podman-build.1.md) | Build a container using a Dockerfile. | | [podman-commit(1)](podman-commit.1.md) | Create new image based on the changed container. | +| [podman-container(1)](podman-container.1.md) | Manage Containers. | | [podman-cp(1)](podman-cp.1.md) | Copy files/folders between a container and the local filesystem. | | [podman-create(1)](podman-create.1.md) | Create a new container. | | [podman-diff(1)](podman-diff.1.md) | Inspect changes on a container or image's filesystem. | | [podman-exec(1)](podman-exec.1.md) | Execute a command in a running container. | | [podman-export(1)](podman-export.1.md) | Export a container's filesystem contents as a tar archive. | | [podman-history(1)](podman-history.1.md) | Show the history of an image. | +| [podman-image(1)](podman-image.1.md) | Manage Images. | | [podman-images(1)](podman-images.1.md) | List images in local storage. | | [podman-import(1)](podman-import.1.md) | Import a tarball and save it as a filesystem image. | | [podman-info(1)](podman-info.1.md) | Displays Podman related system information. | diff --git a/transfer.md b/transfer.md index 025aac194..3a11fe4f6 100644 --- a/transfer.md +++ b/transfer.md @@ -40,11 +40,13 @@ There are other equivalents for these tools | `docker attach` | [`podman exec`](./docs/podman-attach.1.md) | | `docker build` | [`podman build`](./docs/podman-build.1.md) | | `docker commit` | [`podman commit`](./docs/podman-commit.1.md) | +| `docker container`|[`podman container`](./docs/podman-container.1.md) | | `docker cp` | [`podman mount`](./docs/podman-cp.1.md) **** | | `docker create` | [`podman create`](./docs/podman-create.1.md) | | `docker diff` | [`podman diff`](./docs/podman-diff.1.md) | | `docker export` | [`podman export`](./docs/podman-export.1.md) | | `docker history` | [`podman history`](./docs/podman-history.1.md) | +| `docker image` | [`podman image`](./docs/podman-image.1.md) | | `docker images` | [`podman images`](./docs/podman-images.1.md) | | `docker import` | [`podman import`](./docs/podman-import.1.md) | | `docker kill` | [`podman kill`](./docs/podman-kill.1.md) | @@ -55,6 +57,7 @@ There are other equivalents for these tools | `docker ps` | [`podman ps`](./docs/podman-ps.1.md) | | `docker pull` | [`podman pull`](./docs/podman-pull.1.md) | | `docker push` | [`podman push`](./docs/podman-push.1.md) | +| `docker port` | [`podman port`](./docs/podman-port.1.md) | | `docker restart` | [`podman restart`](./docs/podman-restart.1.md)] | | `docker rm` | [`podman rm`](./docs/podman-rm.1.md) | | `docker rmi` | [`podman rmi`](./docs/podman-rmi.1.md) | @@ -77,13 +80,10 @@ Those Docker commands currently do not have equivalents in `podman`: | Missing command | Description| | :--- | :--- | -| `docker container`|| | `docker events` || -| `docker image` || | `docker network` || | `docker node` || | `docker plugin` |podman does not support plugins. We recommend you use alternative OCI Runtimes or OCI Runtime Hooks to alter behavior of podman.| -| `docker port` || | `docker rename` | podman does not support rename, you need to use `podman rm` and `podman create` to rename a container.| | `docker secret` || | `docker service` || |