- macOS (the host binary only compiles on darwin)
- Go 1.26+
- Docker Desktop
- Make
The project has two components:
- Host binary (root
main.go) - a macOS WireGuard server that creates a tunnel to the Docker Desktop Linux VM and manages routes for Docker networks - Setup container (
client/) - a Linux container that runs briefly inside the Docker VM to configure the WireGuard client side
These are separate Go modules with their own go.mod files. The host binary builds the setup container image and runs it in Docker to configure the VM side of the tunnel.
# Build everything (Docker image + Go binary)
make build
# Run locally (builds Docker image, then runs Go binary)
# Note: requires sudo for TUN interface creation
sudo make run
# Run checks
make vet
make lint # requires golangci-lint: brew install golangci-lintAutomated testing is limited since the binary requires root permissions and direct interaction with macOS networking and Docker Desktop. CI runs build verification, go vet, and golangci-lint.
A smoke test script is provided that verifies container connectivity. It assumes the server is already running:
# Terminal 1: start the server
make build
sudo ./docker-mac-net-connect
# Terminal 2: run the smoke test
./scripts/e2e-test.shThe script starts an nginx container, attempts to reach it by IP from macOS, and reports pass/fail.
Before releasing, verify:
make buildsucceedssudo ./docker-mac-net-connectstarts and creates the tunnel./scripts/e2e-test.shpasses- Test as root (simulates launchd):
sudo -i $(pwd)/docker-mac-net-connect - Stop and restart Docker Desktop - verify the server reconnects automatically
- For Homebrew releases:
brew upgrade chipmk/tap/docker-mac-net-connectandsudo brew services restart chipmk/tap/docker-mac-net-connect
Releases are automated via GitHub Actions. To create a release:
- Ensure
mainis in a releasable state and all checks pass - Tag the commit:
git tag v0.X.Y git push origin v0.X.Y
- The release workflow automatically:
- Builds and pushes the multi-arch Docker setup image to GHCR
- Builds darwin/amd64 and darwin/arm64 binaries
- Creates a GitHub release with the binaries and changelog
- Updates the Homebrew formula in chipmk/homebrew-tap (version + sha256)