Alex W.'s Blog

Connecting to host machine from Docker container on macOS

This is from a note I wrote in 2017, there is likely a better way to do this in modern Docker.

Inside the container run sudo ifconfig lo0 alias This will add as an alias for the loopback interface

Now, the container can talk to the host by targeting


  • MySQL restricts user access by origin, therefore must be added to the User entry’s allowed origins

Written by Alex Wendland, who is currently exploring fintech at Pinwheel. Here's a Twitter handle, a GitHub, some LinkedIn, ol' Facebook, or a hip Instagram if you're interested.