From f494c4433227653fc1e15ded2afe2e7019d78cb2 Mon Sep 17 00:00:00 2001 From: anjiawei Date: Fri, 2 Aug 2019 10:59:39 +0800 Subject: [PATCH] add image to conatiner view. Update issue: https://github.com/jesseduffield/lazydocker/issues/144 --- pkg/commands/container.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/commands/container.go b/pkg/commands/container.go index c7faa01e4..944618710 100644 --- a/pkg/commands/container.go +++ b/pkg/commands/container.go @@ -248,7 +248,11 @@ type ContainerCliStat struct { // GetDisplayStrings returns the dispaly string of Container func (c *Container) GetDisplayStrings(isFocused bool) []string { - return []string{c.GetDisplayStatus(), c.Name, c.GetDisplayCPUPerc()} + image := c.Container.Image + if strings.HasPrefix(image, "sha256:") { + image = image[7:20] + } + return []string{c.GetDisplayStatus(), c.Name, image, c.GetDisplayCPUPerc()} } // GetDisplayStatus returns the colored status of the container