{"action":"closed","issue":{"url":"https://api.github.com/repos/docker/docker/issues/9785","labels_url":"https://api.github.com/repos/docker/docker/issues/9785/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/9785/comments","events_url":"https://api.github.com/repos/docker/docker/issues/9785/events","html_url":"https://github.com/docker/docker/issues/9785","id":52709509,"number":9785,"title":"Make comment message to be displayed in docker history command","user":{"login":"dove-young","id":606882,"avatar_url":"https://avatars.githubusercontent.com/u/606882?v=3","gravatar_id":"","url":"https://api.github.com/users/dove-young","html_url":"https://github.com/dove-young","followers_url":"https://api.github.com/users/dove-young/followers","following_url":"https://api.github.com/users/dove-young/following{/other_user}","gists_url":"https://api.github.com/users/dove-young/gists{/gist_id}","starred_url":"https://api.github.com/users/dove-young/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dove-young/subscriptions","organizations_url":"https://api.github.com/users/dove-young/orgs","repos_url":"https://api.github.com/users/dove-young/repos","events_url":"https://api.github.com/users/dove-young/events{/privacy}","received_events_url":"https://api.github.com/users/dove-young/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/kind/feature","name":"kind/feature","color":"AAB3AB"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/proposal","name":"kind/proposal","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":{"login":"tiborvass","id":827131,"avatar_url":"https://avatars.githubusercontent.com/u/827131?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborvass","html_url":"https://github.com/tiborvass","followers_url":"https://api.github.com/users/tiborvass/followers","following_url":"https://api.github.com/users/tiborvass/following{/other_user}","gists_url":"https://api.github.com/users/tiborvass/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborvass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborvass/subscriptions","organizations_url":"https://api.github.com/users/tiborvass/orgs","repos_url":"https://api.github.com/users/tiborvass/repos","events_url":"https://api.github.com/users/tiborvass/events{/privacy}","received_events_url":"https://api.github.com/users/tiborvass/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2014-12-23T02:47:58Z","updated_at":"2015-04-10T04:02:00Z","closed_at":"2015-04-10T04:02:00Z","body":"I raised a discussion here\r\n\r\nhttps://groups.google.com/forum/#!topic/docker-dev/AlbF1ij5oY0\r\n\r\n<code>docker commit</code> command accept a <code>-m</code> parameter which allow users to add some messages to their image, just like which people would do while commit their code.\r\n\r\nBut anyway these messages are not read out when a user issue a <code>docker history</code> command to that image. \r\n\r\nBy inspecting into source code, I found these messages were surely stored with images, so I made a patch to fetch them out. \r\n\r\n````patch\r\nroot@966e1e937644:/go/src/github.com/docker/docker# git diff 739d917..HEAD\r\ndiff --git a/api/client/commands.go b/api/client/commands.go\r\nindex a96089b..04d0496 100644\r\n--- a/api/client/commands.go\r\n+++ b/api/client/commands.go\r\n@@ -1036,7 +1036,7 @@ func (cli *DockerCli) CmdHistory(args ...string) error {\r\n\r\n \r\n        w := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0)\r\n        if !*quiet {\r\n-               fmt.Fprintln(w, \"IMAGE\\tCREATED\\tCREATED BY\\tSIZE\")\r\n+               fmt.Fprintln(w, \"IMAGE\\tCREATED\\tCREATED BY\\tSIZE\\tCOMMENT\")\r\n        }\r\n \r\n        for _, out := range outs.Data {\r\n@@ -1055,7 +1055,8 @@ func (cli *DockerCli) CmdHistory(args ...string) error {\r\n\r\n                        } else {\r\n                                fmt.Fprintf(w, \"%s\\t\", utils.Trunc(out.Get(\"CreatedBy\"), 45))\r\n                        }\r\n-                       fmt.Fprintf(w, \"%s\\n\", units.HumanSize(out.GetInt64(\"Size\")))\r\n+                       fmt.Fprintf(w, \"%s\\t\", units.HumanSize(out.GetInt64(\"Size\")))\r\n+                        fmt.Fprintf(w, \"%s\\n\", out.Get(\"Comment\"))\r\n                } else {\r\n                        if *noTrunc {\r\n                                fmt.Fprintln(w, outID)\r\ndiff --git a/graph/history.go b/graph/history.\r\ngo\r\nindex 2030c4c..853d6c6 100644\r\n--- a/graph/history.go\r\n+++ b/graph/history.go\r\n@@ -36,6 +36,7 @@ func (s *TagStore) CmdHistory(job *engine.Job) engine.Status {\r\n\r\n                out.Set(\"CreatedBy\", strings.Join(img.ContainerConfig.Cmd, \" \"))\r\n                out.SetList(\"Tags\", lookupMap[img.ID])\r\n                out.SetInt64(\"Size\", img.Size)\r\n+                out.Set(\"Comment\", img.Comment)\r\n                outs.Add(out)\r\n                return nil\r\n        })\r\n\r\nroot@966e1e937644:/go/src/github.com/docker/docker#\r\n````\r\n\r\nWith this patch you can have a COMMENT column in the output of <code>docker history</code> command.\r\n\r\n````shell\r\nroot@localhost docker]# ./docker history 2ac9d1098bf1\r\nIMAGE               CREATED             CREATED BY                                      SIZE                COMMENT\r\n2ac9d1098bf1        12 weeks ago        /bin/bash                                       241.4 MB            Add Git and SVN\r\n88d178232033        12 weeks ago        /bin/bash                                       186 MB              Add JDK1.7\r\n4e5e740790d1        3 months ago        /bin/bash                                       535 MB              \r\n88b42ffd1f7c        5 months ago        /bin/sh -c #(nop) ADD file:1fd8d7f9f6557cafc7   373.7 MB            \r\nc69cab00d6ef        5 months ago        /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar   0 B                \r\n511136ea3c5a        18 months ago                                                       0 B                 Imported from -\r\n\r\n\r\n````\r\n\r\n\r\n\r\n"}}