aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/run.go')
-rw-r--r--cmd/podman/run.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go
index 64f8b6856..ff4c3b418 100644
--- a/cmd/podman/run.go
+++ b/cmd/podman/run.go
@@ -30,7 +30,9 @@ var (
runCommand.GlobalFlags = MainGlobalOpts
return runCmd(&runCommand)
},
- Example: "IMAGE [COMMAND [ARG...]]",
+ Example: `podman run imageID ls -alF /etc
+ podman run --net=host imageID dnf -y install java
+ podman run --volume /var/hostdir:/var/ctrdir -i -t fedora /bin/bash`,
}
)
@@ -72,7 +74,8 @@ func runCmd(c *cliconfig.RunValues) error {
ctx := getContext()
// Handle detached start
if createConfig.Detach {
- if err := ctr.Start(ctx); err != nil {
+ // if the container was created as part of a pod, also start its dependencies, if any.
+ if err := ctr.Start(ctx, c.IsSet("pod")); err != nil {
// This means the command did not exist
exitCode = 127
if strings.Index(err.Error(), "permission denied") > -1 {
@@ -117,7 +120,8 @@ func runCmd(c *cliconfig.RunValues) error {
}
}
}
- if err := startAttachCtr(ctr, outputStream, errorStream, inputStream, c.String("detach-keys"), c.Bool("sig-proxy"), true); err != nil {
+ // if the container was created as part of a pod, also start its dependencies, if any.
+ if err := startAttachCtr(ctr, outputStream, errorStream, inputStream, c.String("detach-keys"), c.Bool("sig-proxy"), true, c.IsSet("pod")); err != nil {
// We've manually detached from the container
// Do not perform cleanup, or wait for container exit code
// Just exit immediately
@@ -125,7 +129,6 @@ func runCmd(c *cliconfig.RunValues) error {
exitCode = 0
return nil
}
-
// This means the command did not exist
exitCode = 127
if strings.Index(err.Error(), "permission denied") > -1 {