1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

pass --change changes to the commit job

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: rhatdan)
This commit is contained in:
Daniel, Dao Quang Minh 2014-09-29 04:03:56 -04:00 committed by Dan Walsh
parent 1d27930faa
commit f8e77dfb3d
2 changed files with 4 additions and 0 deletions

View file

@ -1702,6 +1702,8 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
flPause := cmd.Bool([]string{"p", "-pause"}, true, "Pause container during commit")
flComment := cmd.String([]string{"m", "-message"}, "", "Commit message")
flAuthor := cmd.String([]string{"a", "#author", "-author"}, "", "Author (e.g., \"John Hannibal Smith <hannibal@a-team.com>\")")
flChanges := opts.NewListOpts(nil)
cmd.Var(&flChanges, []string{"c", "-change"}, "Apply a modification before committing the image")
// FIXME: --run is deprecated, it will be replaced with inline Dockerfile commands.
flConfig := cmd.String([]string{"#run", "#-run"}, "", "This option is deprecated and will be removed in a future version in favor of inline Dockerfile-compatible commands")
cmd.Require(flag.Max, 2)
@ -1726,6 +1728,7 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
v.Set("tag", tag)
v.Set("comment", *flComment)
v.Set("author", *flAuthor)
v.Set("changes", strings.Join(flChanges.GetAll(), "\n"))
if *flPause != true {
v.Set("pause", "0")

View file

@ -518,6 +518,7 @@ func postCommit(eng *engine.Engine, version version.Version, w http.ResponseWrit
job.Setenv("tag", r.Form.Get("tag"))
job.Setenv("author", r.Form.Get("author"))
job.Setenv("comment", r.Form.Get("comment"))
job.Setenv("changes", r.Form.Get("changes"))
job.SetenvSubEnv("config", &config)
job.Stdout.Add(stdoutBuffer)