ctr: enable specifying additional environment variables

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett
2017-05-24 12:39:34 -04:00
parent ab137bfef8
commit 02fa534d71
4 changed files with 52 additions and 4 deletions

View File

@@ -61,6 +61,8 @@ func spec(id string, config *ocispec.ImageConfig, context *cli.Context) *specs.S
}
}
env := replaceOrAppendEnvValues(config.Env, context.StringSlice("env"))
return &specs.Spec{
Version: specs.Version,
Platform: specs.Platform{
@@ -74,7 +76,7 @@ func spec(id string, config *ocispec.ImageConfig, context *cli.Context) *specs.S
Args: args,
Terminal: tty,
Cwd: cwd,
Env: config.Env,
Env: env,
User: specs.User{
Username: config.User,
},