wagoodman / dive

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

Fix #475 failure to inspect `podman://ubuntu:24.04` #476

Open abitrolly opened 1 year ago

abitrolly commented 1 year ago

Fix #475.

Inspecting podman://ubuntu:24.04 fails with the latest revision dive.

$ ./dive podman://ubuntu:24.04
Image Source: docker://podman://ubuntu:24.04
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'podman://ubuntu:24.04'...
cannot fetch image
cannot find docker client executable

The problem is caused by net/url.Parse() (https://go.dev/play/p/0fPOA--41-1).

panic: parse "podman://ubuntu:24.04": invalid port ":24.04" after host

Testing the fix

$ ./divefix podman://ubuntu:24.04
Image Source: podman://ubuntu:24.04
...

$ ./divefix ubuntu:24.04 --source podman
Image Source: podman://ubuntu:24.04
...

$ ./divefix podman://ubuntu:24.04 --source docker
Image Source: podman://ubuntu:24.04
...