chipmk / docker-mac-net-connect

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

Doesn't work on M1 Mac #1

Closed dobegor closed 2 years ago

dobegor commented 2 years ago

While it does work for me on Intel mac, it does not on M1 one. Log says that VM setup was done, but peer is not available:

DEBUG: (utun10) 2021/12/29 15:50:21 Setting up Wireguard on Docker Desktop VM
{"status":"Pulling from chipmk/docker-mac-net-connect/setup","id":"latest"}
{"status":"Digest: sha256:8c44fc76845a4ba0eb18de835bec6d3b79089602ec10108e760d9b2a9ec6dfb6"}
{"status":"Status: Image is up to date for ghcr.io/chipmk/docker-mac-net-connect/setup:latest"}
Adding route for 172.17.0.0/16 -> utun10 (bridge)
DEBUG: (utun10) 2021/12/29 15:50:22 Watching Docker events
DEBUG: (utun10) 2021/12/29 15:51:50 peer(SPVw…xxkI) - Sending handshake initiation
ERROR: (utun10) 2021/12/29 15:51:50 peer(SPVw…xxkI) - Failed to send handshake initiation: no known endpoint for peer

On the VM the Wireguard config is empty:

bash-5.0# wg
interface: chip0
bash-5.0# wg showconf chip0
[Interface]
dobegor commented 2 years ago

@gregnr

It seems that error messages are only generated, but they are not logged anywhere (as fmt.Errorf just returns a formatted string): https://github.com/chipmk/docker-mac-net-connect/blob/main/client/main.go#L25

dobegor commented 2 years ago

I've filed a PR to fix error messages: #2. It seems, though, that just rebuilding the setup Docker image for ARM fixes the problem altogether. Can you please push an updated Docker image with arm arch to your registry @gregnr ?

gregnr commented 2 years ago

@dobegor Thanks for reaching out and all the detail. You're right - error logs are handled incorrectly. I'll take a look at your PR.

Thanks for all the debugging and glad you were able to fix it - I will definitely push an ARM variant of the image and send an update when that's done.

gregnr commented 2 years ago

@dobegor I've added an ARM64 build manifest to the image - would you mind verifying that this work on the M1?

dobegor commented 2 years ago

@gregnr yes - tried with a clean install and it works now! Awesome thanks for quick fix!