Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
| ... | ... |
@@ -109,6 +109,9 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
|
| 109 | 109 |
indented.WriteString("]\n")
|
| 110 | 110 |
|
| 111 | 111 |
if tmpl == nil {
|
| 112 |
+ // Note that we will always write "[]" when "-f" isn't specified, |
|
| 113 |
+ // to make sure the output would always be array, see |
|
| 114 |
+ // https://github.com/docker/docker/pull/9500#issuecomment-65846734 |
|
| 112 | 115 |
if _, err := io.Copy(cli.out, indented); err != nil {
|
| 113 | 116 |
return err |
| 114 | 117 |
} |