summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-04 06:41:07 -0800
committerGitHub <noreply@github.com>2019-01-04 06:41:07 -0800
commit6868b5aa1444404113bc6a4582203fbbf89490c2 (patch)
tree2be4469136fd0f7c179352d6a721d2e9f0a61f47 /cmd
parent9ffd4806163e410d51d0f0cbece45b7405ff9fee (diff)
parent75578aad61c1e9fae021223ece70cb83e3e2bcf2 (diff)
downloadpodman-6868b5aa1444404113bc6a4582203fbbf89490c2.tar.gz
podman-6868b5aa1444404113bc6a4582203fbbf89490c2.tar.bz2
podman-6868b5aa1444404113bc6a4582203fbbf89490c2.zip
Merge pull request #2045 from vrothberg/init
add init support
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common.go9
-rw-r--r--cmd/podman/create.go10
-rw-r--r--cmd/podman/varlink/io.podman.varlink2
3 files changed, 21 insertions, 0 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index 8404a29b8..0fc9a6acc 100644
--- a/cmd/podman/common.go
+++ b/cmd/podman/common.go
@@ -321,6 +321,15 @@ var createFlags = []cli.Flag{
Value: "bind",
},
cli.BoolFlag{
+ Name: "init",
+ Usage: "Run an init binary inside the container that forwards signals and reaps processes",
+ },
+ cli.StringFlag{
+ Name: "init-path",
+ // Do not use the Value field for setting the default value to determine user input (i.e., non-empty string)
+ Usage: fmt.Sprintf("Path to the container-init binary (default: %q)", libpod.DefaultInitPath),
+ },
+ cli.BoolFlag{
Name: "interactive, i",
Usage: "Keep STDIN open even if not attached",
},
diff --git a/cmd/podman/create.go b/cmd/podman/create.go
index dae429047..395a64b3b 100644
--- a/cmd/podman/create.go
+++ b/cmd/podman/create.go
@@ -809,6 +809,16 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
Syslog: c.GlobalBool("syslog"),
}
+ if c.Bool("init") {
+ initPath := c.String("init-path")
+ if initPath == "" {
+ initPath = runtime.GetConfig().InitPath
+ }
+ if err := config.AddContainerInitBinary(initPath); err != nil {
+ return nil, err
+ }
+ }
+
if config.Privileged {
config.LabelOpts = label.DisableSecOpt()
} else {
diff --git a/cmd/podman/varlink/io.podman.varlink b/cmd/podman/varlink/io.podman.varlink
index c1b7c703a..4e8b69faf 100644
--- a/cmd/podman/varlink/io.podman.varlink
+++ b/cmd/podman/varlink/io.podman.varlink
@@ -211,6 +211,8 @@ type Create (
hostname: string,
image: string,
image_id: string,
+ init: bool,
+ init_path: string,
builtin_imgvolumes: []string,
id_mappings: IDMappingOptions,
image_volume_type: string,