Browse Source

Truncating image id to 12 in docker ps

Signed-off-by: Mohammed Aaqib Ansari <maaquib@gmail.com>
Mohammed Aaqib Ansari 10 years ago
parent
commit
1a2ccf59ee
1 changed files with 3 additions and 0 deletions
  1. 3 0
      api/client/ps/custom.go

+ 3 - 0
api/client/ps/custom.go

@@ -64,6 +64,9 @@ func (c *containerContext) Image() string {
 	if c.c.Image == "" {
 		return "<no image>"
 	}
+	if c.trunc {
+		return stringutils.Truncate(c.c.Image, 12)
+	}
 	return c.c.Image
 }