diff --git a/api/client/commands.go b/api/client/commands.go index 9776936506..f25b6bbb43 100644 --- a/api/client/commands.go +++ b/api/client/commands.go @@ -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 \")") + 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") diff --git a/api/server/server.go b/api/server/server.go index 78ca4b7829..ef6951c691 100644 --- a/api/server/server.go +++ b/api/server/server.go @@ -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)