Open fidian opened 5 years ago
I found a similar behaviour when running the container on Win10 from MINGW64 without -it
:
docker run --rm -v //var/run/docker.sock://var/run/docker.sock wagoodman/dive <IMAGE>
It seems that the problem is not in building the cache, which is the apparent last step, but actually in starting the UI (gocui/termbox). I haven't pinpointed the root cause yet, however, it appears to be a race condition on the startup of the process that only shows itself when run in a container. With larger images, there is enough time spent fetching, parsing, and analyzing the image (even relatively small images) such that the problem does not present itself.
For instance, as you mentioned, this will not work:
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
wagoodman/dive:latest hello-world
However, this will work (shelling into the container and running dive manually):
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
wagoodman/dive:latest sh
# /dive hello-world
After a bit of trial and error, it seems that the threshold for this behavior is at ~25ms after the container/processes starts up --so a sleep of 100ms after start up seems to be a good enough workaround for now. I'm not a fan of phantom sleeps making behavior "better", so I won't close this issue yet.
This workaround will make it in the next release.
However, this will work (shelling into the container and running dive manually):
docker run --rm -it \ -v /var/run/docker.sock:/var/run/docker.sock \ wagoodman/dive:latest sh # /dive hello-world
Is this feature still available? I just tried:
# winpty docker run --rm -it \
> -v //var/run/docker.sock://var/run/docker.sock \
> wagoodman/dive:latest sh
Image Source: docker://sh
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'sh'...
Using default tag: latest
Error response from daemon: pull access denied for sh, repository does not exist or may require 'docker login': denied: requested acce
ss to the resource is denied
cannot fetch image
Failed to write to log, invalid argument
exit status 1
It does as long as I put in the right command (my bad, I missed --entrypoint ''
):
$ docker run --rm -it \
> -v /var/run/docker.sock:/var/run/docker.sock \
> --entrypoint '' wagoodman/dive:latest sh
# dive hello-world
Image Source: docker://hello-world
Fetching image... (this can take a while for large images)
Analyzing image...
Building cache...
#
On Windows, double-quotes are required:
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock --entrypoint "" wagoodman/dive:latest sh
Otherwise you'll get:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"''\": executable file not found in $PATH": unknown.
On Windows, double-quotes are required
Is this with cmd, powershell or WSL? On MSYS2/MINGW, either '
or "
work.
This issue seems to be solved for me with the latest wagoodman/dive:latest
image. It shows a legit error if -t
is not used. It crashes if winpty
is not used (#253). But it is not frozen in "Building cache" anymore. @fidian, does the latest image work for you?
@wagoodman, I found an unexpected behaviour: step 'Fetching image...' takes around 18s for a given image (no matter if it is already available locally), and 'Analizing image...' is then printed together with 'Building cache...'. I believe that those 18s correspond to 'Analizing', but the message is being printed after analysis, instead of before. Otherwise, it would mean that dive is downloading the image every time.
I seem to run into a similar problem: No more output after "Building cache ...
", no error message, nothing.
System: Windows 10
Release: Most recent dive
for Windows, downloaded today.
In other words: I can't run it at all on Windows here.
@jkpubsrc I cannot reproduce. I just tried the latest wagoodman/dive:latest on Windows 10 (from MSYS2) using Docker Desktop 3.5.2 with ther Hyper-V engine. Can you provide more info about your setup and the command you are trying to execute?
I'm running Docker on my Mac using the following command:
Its output seems stuck when it is analyzing the image.
I've waited minutes for it to build the cache on this 1.85kB image.