diff --git a/pkg/commands/docker.go b/pkg/commands/docker.go index bae0c54a..4504ab76 100644 --- a/pkg/commands/docker.go +++ b/pkg/commands/docker.go @@ -4,7 +4,6 @@ import ( "context" "strings" - "github.com/davecgh/go-spew/spew" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" @@ -77,7 +76,12 @@ func (c *DockerCommand) GetImages() ([]*Image, error) { ownImages := make([]*Image, len(images)) for i, image := range images { - c.Log.Warn(spew.Sdump(image)) + // func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error) + + history, err := c.Client.ImageHistory(context.Background(), image.ID) + if err != nil { + return nil, err + } name := "none" tags := image.RepoTags @@ -95,6 +99,7 @@ func (c *DockerCommand) GetImages() ([]*Image, error) { Client: c.Client, OSCommand: c.OSCommand, Log: c.Log, + History: history, } } diff --git a/pkg/commands/image.go b/pkg/commands/image.go index 6f428a51..44f87815 100644 --- a/pkg/commands/image.go +++ b/pkg/commands/image.go @@ -16,6 +16,7 @@ type Image struct { Tag string ID string Image types.ImageSummary + History []types.ImageHistory Client *client.Client OSCommand *OSCommand Log *logrus.Entry diff --git a/pkg/gui/images_panel.go b/pkg/gui/images_panel.go index 58574887..4ad7074f 100644 --- a/pkg/gui/images_panel.go +++ b/pkg/gui/images_panel.go @@ -104,7 +104,13 @@ func (gui *Gui) renderImageConfig(mainView *gocui.View, Image *commands.Image, w if err != nil { return err } - gui.renderString(gui.g, "main", string(data)) + + historyData, err := json.MarshalIndent(&Image.History, "", " ") + if err != nil { + return err + } + + gui.renderString(gui.g, "main", string(data)+"\n"+string(historyData)) return nil }