Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to see all layers? #328

Closed
caleb15 opened this issue Nov 25, 2020 · 3 comments · Fixed by #399
Closed

How to see all layers? #328

caleb15 opened this issue Nov 25, 2020 · 3 comments · Fixed by #399
Labels
bug Something isn't working

Comments

@caleb15
Copy link

caleb15 commented Nov 25, 2020

This is probably just me missing something obvious but with a image that has so many layers that it doesn't fit in the screen, the last few layers are not shown and I don't know how to get to them. I tried pressing the down arrow and page down and nothing happened.

image

image

As you can see in the image above there are more layers not displayed. Note that the image immediately above shows layers in reverse order (first layer at bottom, last layer on top)

@mjlescano
Copy link

Hi! I'm having the same problem, maybe it is worth noting that my image is on a private repo and uses a multi stage build?

@nguyening
Copy link

nguyening commented Oct 22, 2021

diff --git a/runtime/ui/view/layer.go b/runtime/ui/view/layer.go
index c1f9d0c..b3ffc91 100644
--- a/runtime/ui/view/layer.go
+++ b/runtime/ui/view/layer.go
@@ -2,6 +2,7 @@ package view

 import (
 	"fmt"
+	"strings"
 	"github.com/awesome-gocui/gocui"
 	"github.com/sirupsen/logrus"
 	"github.com/spf13/viper"
@@ -324,6 +325,9 @@ func (v *Layer) Render() error {
 				layerStr = fmt.Sprintf("%-4d", layer.Index)
 			} else {
 				layerStr = layer.String()
+				if i := strings.Index(layerStr, "\n"); i != -1 {
+					layerStr = layerStr[:i]
+				}
 			}

 			compareBar := v.renderCompareBar(idx)

May or may not be your problem: I have observed this in Dockerfiles with heredocs.

The JSON dumped by -j shows all the layers I expect but in the GUI having any layers with a multiline string ends up hiding layers

Screen Shot 2021-10-22 at 1 18 30 PM

the RUN echo 1 layer is missing and if I try to cursor down I'm either prevented, or in this case dive just exits.

If I apply the patch above it looks like this:

Screen Shot 2021-10-22 at 1 20 23 PM

@wagoodman
Copy link
Owner

Fixed in #399

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants