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