Fix environ substitutions in docker commit --change ...

The building machinery was being handed an uninitialized container
Config.  This changes it to use the target container's Config.

Resolves #30538

Signed-off-by: Anthony Sottile <asottile@umich.edu>
This commit is contained in:
Anthony Sottile
2017-11-22 13:31:26 -08:00
parent 267847712e
commit 0785836c4b
5 changed files with 62 additions and 6 deletions

View File

@@ -149,6 +149,10 @@ func (daemon *Daemon) Commit(name string, c *backend.ContainerCommitConfig) (str
defer daemon.containerUnpause(container)
}
if c.MergeConfigs && c.Config == nil {
c.Config = container.Config
}
newConfig, err := dockerfile.BuildFromConfig(c.Config, c.Changes)
if err != nil {
return "", err