DNS resolution
Docker commands needs to resolve VHOSTS from your local machine, in order to do so you need to setup a custom DNS domain that point to your local DNS server.
Setup custom DNS resolver
MacOS
sudo mkdir -v /etc/resolver
echo "nameserver 127.0.0.1" | sudo tee /etc/resolver/dev.local
Linux
echo "nameserver 127.0.0.1" | sudo tee -a /etc/resolv.conf
Then restart your computer but keep in mind that this file could be overriden by a service, and you can lost the internet connection. In that case we recommend to remove the previous line and add every host in your /etc/hosts file.
echo "127.0.0.1 my_project_name.dev.local" | sudo tee -a /etc/hosts
If the queries are too long maybe you already have a nameserver configured which it used before and then switch to the right one, in that case you can edit the file /etc/resolv.conf and move the previous line on top of it.
Windows
Run PowerShell as administrator then run the following commands :
Add-DnsClientNrptRule -Namespace ".dev.local" -NameServers "127.0.0.1"