{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/17692","labels_url":"https://api.github.com/repos/docker/docker/issues/17692/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/17692/comments","events_url":"https://api.github.com/repos/docker/docker/issues/17692/events","html_url":"https://github.com/docker/docker/pull/17692","id":115093490,"number":17692,"title":"Add --format support to images command","user":{"login":"vdemeester","id":6508,"avatar_url":"https://avatars.githubusercontent.com/u/6508?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemeester","html_url":"https://github.com/vdemeester","followers_url":"https://api.github.com/users/vdemeester/followers","following_url":"https://api.github.com/users/vdemeester/following{/other_user}","gists_url":"https://api.github.com/users/vdemeester/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemeester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemeester/subscriptions","organizations_url":"https://api.github.com/users/vdemeester/orgs","repos_url":"https://api.github.com/users/vdemeester/repos","events_url":"https://api.github.com/users/vdemeester/events{/privacy}","received_events_url":"https://api.github.com/users/vdemeester/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/2-code-review","name":"status/2-code-review","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-04T16:35:30Z","updated_at":"2015-11-14T23:13:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/17692","html_url":"https://github.com/docker/docker/pull/17692","diff_url":"https://github.com/docker/docker/pull/17692.diff","patch_url":"https://github.com/docker/docker/pull/17692.patch"},"body":"The `ps` commands had `--format` flags, this add it to the `images` command. This kinda fixes issues like : #17304. 🐮\r\n\r\n- It refactors and rename the package `api/client/ps` to `api/client/formatter`,\r\n- It adds a a image formatter and update `api/client/images.go`.\r\n\r\nThe default output of `docker images` remain unchanged. But it's now possible to use a `--format` flag and to setup a default `images` format in the client configuration:\r\n\r\n```bash\r\n$ docker images\r\nREPOSITORY          TAG                 IMAGE ID            CREATED AT                          VIRTUAL SIZE\r\nswarm               latest              6b40fe7724bd        2015-11-03 20:07:32 +0000 UTC ago   15.6 MB\r\nnginx               latest              914c82c5a678        2015-10-28 22:01:52 +0000 UTC ago   132.7 MB\r\n\r\n$ docker images --format=\"{{.ID}}\"\r\n6b40fe7724bd\r\n914c82c5a678\r\n\r\n$ docker images --format=\"table {{.ID}}\\t{{.Repository}}\"\r\nIMAGE ID            REPOSITORY\r\n6b40fe7724bd        swarm\r\n914c82c5a678        nginx\r\n\r\n$ docker images --no-trunc --format=\"{{.ID}}\\t{{.Repository}}\"\r\n6b40fe7724bd29107f6182ca2befec011cdf524b23ebc4c9a33591d6b7aea4ee        swarm\r\n914c82c5a678cf9fa73c25d91d30f5e174ac69f6b494890d262cc58f43b304ef        nginx\r\n\r\n$ docker images --format=\"raw\"\r\nrepository: swarm\r\ntag: latest\r\nimage_id: 6b40fe7724bd\r\ncreated_at: 2015-11-03 20:07:32 +0000 UTC\r\nvirtual_size: 15.6 MB\r\nrepository: nginx\r\ntag: latest\r\nimage_id: 914c82c5a678\r\ncreated_at: 2015-10-28 22:01:52 +0000 UTC\r\nvirtual_size: 132.7 MB\r\n```\r\n\r\nWhat still need to do :\r\n- [ ] Update/Rewrite the tests for `api/client/formatter`\r\n- [ ] Add integration tests\r\n- [ ] Refactor a bit the code, as it is not that great as of now, there is room for improvement :stuck_out_tongue_closed_eyes:.\r\n- [X] update shell completion\r\n- [ ] Update docs :wink: \r\n\r\n🐸\r\n\r\nSigned-off-by: Vincent Demeester <vincent@sbr.pm>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/156756365","html_url":"https://github.com/docker/docker/pull/17692#issuecomment-156756365","issue_url":"https://api.github.com/repos/docker/docker/issues/17692","id":156756365,"user":{"login":"vdemeester","id":6508,"avatar_url":"https://avatars.githubusercontent.com/u/6508?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemeester","html_url":"https://github.com/vdemeester","followers_url":"https://api.github.com/users/vdemeester/followers","following_url":"https://api.github.com/users/vdemeester/following{/other_user}","gists_url":"https://api.github.com/users/vdemeester/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemeester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemeester/subscriptions","organizations_url":"https://api.github.com/users/vdemeester/orgs","repos_url":"https://api.github.com/users/vdemeester/repos","events_url":"https://api.github.com/users/vdemeester/events{/privacy}","received_events_url":"https://api.github.com/users/vdemeester/received_events","type":"User","site_admin":false},"created_at":"2015-11-14T23:13:42Z","updated_at":"2015-11-14T23:13:42Z","body":"I will :wink: during DockerCon or just after :wink: "}}