Dive don't find local images with docker desktop
What happened: I'm unable to fetch for local images using dive
What you expected to happen: I expect to be able to inspect images locally
How to reproduce it (as minimally and precisely as possible): Just install latest dive and docker version, build an image and try to inspect it
Environment:
- OS version : Ubuntu 22.04
- Docker version (if applicable): Docker version 27.0.3, build 7d4bcd8
- Dive version : 0.12.0
Here is what it look like :
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
work-database latest c777209c4241 6 days ago 796MB
work-frontend latest ba1bcaf3bdb9 5 weeks ago 150MB
work-backend latest d4f717757028 5 weeks ago 129MB
dive work-database:latest
Image Source: docker://work-database:latest
Fetching image... (this can take a while for large images)
Handler not available locally. Trying to pull 'work-database:latest'...
Error response from daemon: Get "https://registry-1.docker.io/v2/": dialing registry-1.docker.io:443 container via direct connection because has no HTTPS proxy: resolving host registry-1.docker.io: lookup registry-1.docker.io on 127.0.0.53:53: no such host
cannot fetch image
exit status 1
I had a lot of local docker images but after I installed dive via sudo snap install dive they are gone :open_mouth:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
@RafaelWO dive probably didn't affect that, check your docker context and switch it if needed:
$> docker context ls
@mark2185 I only have one context :thinking:
$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT ERROR
default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock
Either way, I removed dive from snap and installed it via the latest .deb file from the GitHub releases.
I don't have any other ideas unfortunately, but it's highly unlikely dive deleted your images.
I don't have any other ideas unfortunately, but it's highly unlikely dive deleted your images.
I just noticed that apt installed an update of Docker that day which is likely the issue. Sorry for bothering!
I had a lot of local docker images but after I installed dive via
sudo snap install divethey are gone 😮$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE
Pls it is clearly not related to the issue I made can you open another issues.
I'm running dive 0.12.0 with the latest Docker Desktop 4.33.0 on Intel-based macOS 14.5, and I can reproduce this exact issue.
Through some experimentation, I've narrowed down to having to set the DOCKER_HOST environment variable before running dive on local images:
export DOCKER_HOST=$(docker context inspect -f '{{ .Endpoints.docker.Host }}')
Hope this helps.
I could also not scan local images with dive 0.12.0 installed from snap on Ubuntu 24.04 with Docker 27.1.1.
I switched to the dive alias from the README that runs dive from a docker image instead, and that finds my local images.
I have the same issue on a Mac with Docker Desktop
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
debian latest b8084b1a576c 9 days ago 205MB
go latest 50652a079a53 6 weeks ago 345MB
provectuslabs/kafka-ui latest 8f2ff02d64b0 5 months ago 411MB
dive debian:latest
Image Source: docker://debian:latest
Fetching image... (this can take a while for large images)
cannot fetch image
could not find image config
For those who use OrbStack on MacOS,
to make it work run
export DOCKER_HOST=$(docker context inspect -f '{{ .Endpoints.docker.Host }}')
The local image is stuck at 'Fetching image... (this can take a while for large images)'.
I have this issue as well on MacOS w/ Docker Desktop, docker images ls does correctly list my images, but dive doesn't find them... I noticed that there are 2 contexts when I docker context ls:
docker context ls
NAME DESCRIPTION DOCKER ENDPOINT ERROR
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
desktop-linux * Docker Desktop unix:///Users/deftdawg/.docker/run/docker.sock
DOCKER_HOSTisn't set in my environment- if I run
diveit will fetch docker hub images that are already present locally in mydocker images, and it won't find local images I've built. - if I prefix the
DOCKER_HOSTvar,DOCKER_HOST=$(docker context inspect -f '{{ .Endpoints.docker.Host }}') dive btop-docker:hcy9ccb27a0470pablkxx7sxpbp88gfpit finds my local images
Seems like dive is assuming the default (unix:///var/run/docker.sock) when DOCKER_HOST isn't defined when perhaps it should be asking docker, either that or Docker Desktop should be defining DOCKER_HOST.
I had a lot of local docker images but after I installed dive via
sudo snap install divethey are gone 😮$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE
Had the exact same issue. I suspect it is the Ubuntu snap craziness. Installing dive using snap probably force-replaced my non-snap docker install, and the local repo then seems to gets lost.
Really need to get rid of Ubuntu, they mess everything up with that snap abomination.
export DOCKER_HOST=$(docker context inspect -f '{{ .Endpoints.docker.Host }}') Hope this helps.
This fixed the issue for me (MacOS Colima). There must be a lot of Mac users with alternative runtimes so I've created a PR to update the README.
export DOCKER_HOST=$(docker context inspect -f '{{ .Endpoints.docker.Host }}') Hope this helps.
This fixed the issue for me (MacOS Colima). There must be a lot of Mac users with alternative runtimes so I've created a PR to update the README.
This doesn't work for me unfortunately :(
If you haven't restarted your Docker process in a while, you may get stuck waiting for images to download with this workaround, click restart on Docker desktop (assuming its safe to do so for whatever containers you might have running), then try again.
If you haven't restarted your Docker process in a while, you may get stuck waiting for images to download with this workaround, click restart on Docker desktop (assuming its safe to do so for whatever containers you might have running), then try again.
I have restarted Docker Desktop multiple times in the past 3 weeks.
I had a lot of local docker images but after I installed dive via
sudo snap install divethey are gone 😮$ docker images REPOSITORY TAG IMAGE ID CREATED SIZEHad the exact same issue. I suspect it is the Ubuntu snap craziness. Installing dive using snap probably force-replaced my non-snap docker install, and the local repo then seems to gets lost.
Really need to get rid of Ubuntu, they mess everything up with that snap abomination.
I'm having this same issue right not and I'm really stuck, does anyone have any solution ? It would be much appreciated.
Had the exact same issue. I suspect it is the Ubuntu snap craziness. Installing dive using snap probably force-replaced my non-snap docker install, and the local repo then seems to gets lost.
I'm having this same issue right not and I'm really stuck, does anyone have any solution ? It would be much appreciated.
That looks like #546.
I'm curious if this issue would go away once #569 is implemented. From what I'm reading here it seems like it since stereoscope does not assume a socket paths.
It looks like this is fixed with dive-0.13.1 (and possibly even an earlier version).
I ran across this today on macOS, though the suggestion above to set the DOCKER_HOST endpoint didn't work for me. I noticed I was still using dive-0.12.0, and after upgrading to dive-0.13.1, dive has no issues opening images locally now.
If you installed dive with snap on Ubuntu.
snap info dive
states that you have to run
sudo snap connect dive:docker-executables docker:docker-executables
sudo snap connect dive:docker-daemon docker:docker-daemon
This worked for me.