mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 13:11:30 +00:00
Merge pull request #9123 from rhatdan/commit-change
Patch to commit-change patch to add docker import support
This commit is contained in:
+16
-3
@@ -1,6 +1,9 @@
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/docker/docker/engine"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/runconfig"
|
||||
@@ -18,11 +21,21 @@ func (daemon *Daemon) ContainerCommit(job *engine.Job) engine.Status {
|
||||
}
|
||||
|
||||
var (
|
||||
config = container.Config
|
||||
newConfig runconfig.Config
|
||||
config = container.Config
|
||||
stdoutBuffer = bytes.NewBuffer(nil)
|
||||
newConfig runconfig.Config
|
||||
)
|
||||
|
||||
if err := job.GetenvJson("config", &newConfig); err != nil {
|
||||
buildConfigJob := daemon.eng.Job("build_config")
|
||||
buildConfigJob.Stdout.Add(stdoutBuffer)
|
||||
buildConfigJob.Setenv("changes", job.Getenv("changes"))
|
||||
// FIXME this should be remove when we remove deprecated config param
|
||||
buildConfigJob.Setenv("config", job.Getenv("config"))
|
||||
|
||||
if err := buildConfigJob.Run(); err != nil {
|
||||
return job.Error(err)
|
||||
}
|
||||
if err := json.NewDecoder(stdoutBuffer).Decode(&newConfig); err != nil {
|
||||
return job.Error(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user