I want to make it so that the docker container I spin up use the same /etc/hosts
settings as on the host machine I run from. Is there a way to do this?
I know there is an --add-host
option with docker run but that's not exactly what I want because the host machine's /etc/hosts
file may be different on different machines so it's not great for me to hardcode exact IP/hosts with --add-host
.
Add standard host file -
Add a mapping for server 'foo' -
Add mappings for multiple servers
Reference - http://jasani.org/2014/11/19/docker-now-supports-adding-host-mappings/