wagoodman / dive

A tool for exploring each layer in a docker image
MIT License
47.48k stars 1.79k forks source link

Fix stream podman command hanging #349

Closed hedrox closed 1 year ago

hedrox commented 3 years ago

I found that using an image that is not in podman locally would hang dive. It seems like this writer not being closed on the streamPodmanCmd function was the culprit. To test this issue, fist make sure ubuntu is not in podman and then the outputs should be:

Before:

$ dive podman://docker.io/library/ubuntu
Image Source: podman://docker.io/library/ubuntu
Fetching image... (this can take a while for large images)
Error: unable to find 'docker.io/library/ubuntu' in local storage: no such image
(here it will hang)

After:

$ dive podman://docker.io/library/ubuntu
Image Source: podman://docker.io/library/ubuntu
Fetching image... (this can take a while for large images)
Error: unable to find 'docker.io/library/ubuntu' in local storage: no such image
cannot fetch image
unable to resolve image 'docker.io/library/ubuntu': could not find image manifest