aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/start.go8
-rw-r--r--docs/podman-start.1.md3
2 files changed, 10 insertions, 1 deletions
diff --git a/cmd/podman/start.go b/cmd/podman/start.go
index 00d153904..8f6fc5800 100644
--- a/cmd/podman/start.go
+++ b/cmd/podman/start.go
@@ -96,6 +96,14 @@ func startCmd(c *cli.Context) error {
inputStream = nil
}
+ ctrState, err := ctr.State()
+ if err != nil {
+ return errors.Wrapf(err, "unable to get container state")
+ }
+ if ctrState == libpod.ContainerStateRunning {
+ return attachCtr(ctr, os.Stdout, os.Stderr, inputStream, c.String("detach-keys"), c.BoolT("sig-proxy"))
+ }
+
if err := startAttachCtr(ctr, os.Stdout, os.Stderr, inputStream, c.String("detach-keys"), c.Bool("sig-proxy")); err != nil {
return errors.Wrapf(err, "unable to start container %s", ctr.ID())
}
diff --git a/docs/podman-start.1.md b/docs/podman-start.1.md
index 24fc49a8e..29f335781 100644
--- a/docs/podman-start.1.md
+++ b/docs/podman-start.1.md
@@ -11,7 +11,8 @@ podman start - Start one or more containers
## DESCRIPTION
Start one or more containers. You may use container IDs or names as input. The *attach* and *interactive*
options cannot be used to override the *--tty** and *--interactive* options from when the container
-was created.
+was created. If you attempt to start a running container with the *--attach* option, podman will simply
+attach to the container.
## OPTIONS