chipmk / docker-mac-net-connect

Connect directly to Docker-for-Mac containers via IP address 🐳 💻
MIT License
402 stars 41 forks source link

Not working after Docker update? #33

Closed danbarker closed 7 months ago

danbarker commented 7 months ago

I recently upgraded my Docker version, now I'm on version 4.26.1 (131620). It seems that docker-mac-net-connect is no longer working and I'm trying to figure out why. I have tried uninstalling and reinstalling, restarting, rebuilding etc in various combinations. One thing I can confirm is that the routes table doesn't seem to be getting added to when a network is created. E.g. if I follow the instructions from the Readme:

Screenshot 2024-01-29 at 14 06 13

the new utun interface is not added. Likewise, when I bring my Docker containers up, the utun routes for them are not added, unlike on my colleagues' machines:

On colleague's machine:

sudo netstat -rnf inet | grep utun
10/24       utun3       USc       utun3
10.33.33.2     10.33.33.1     UH       utun3
172.17       utun3       USc       utun3
172.200      utun3       USc       utun3

On my machine:

sudo netstat -rnf inet | grep utun
10.33.33.2     10.33.33.1     UH       utun3

Has anyone had any similar issues? I seem a bit stuck!

danbarker commented 7 months ago

I managed to solve this by running the command directly instead of as a service , e.g. sudo /opt/homebrew/Cellar/docker-mac-net-connect/v0.1.2/bin/docker-mac-net-connect. I saw that it was having issues connecting to the Docker socket:

DEBUG: (utun5) 2024/01/29 14:16:59 Interface utun5 created
DEBUG: (utun5) 2024/01/29 14:16:59 Wireguard server listening
DEBUG: (utun5) 2024/01/29 14:16:59 Setting up Wireguard on Docker Desktop VM
Image doesn't exist locally. Pulling...
ERROR: (utun5) 2024/01/29 14:16:59 Failed to setup VM: failed to pull setup image: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBUG: (utun5) 2024/01/29 14:17:04 Setting up Wireguard on Docker Desktop VM

I uninstalled Docker desktop and reinstalled, which fixed the issue.

lubronzhan commented 7 months ago

Same here, reinstall docker desktop solved the issue

https://docs.docker.com/desktop/uninstall/