title: How can you make the Docker container use the host machine's '/etc/hosts' file?
body: <p>I want to make it so that the Docker container I spin up use the same <code>/etc/hosts</code> settings as on the host machine I run from. Is there a way to do this?</p>
  <p>I know there is an <a href="https://docs.docker.com/reference/run/#managing-etc-hosts" rel="noreferrer"><code>--add-host</code></a> option with <code>docker run</code>, but that's not exactly what I want because the host machine's <code>/etc/hosts</code> file may be different on different machines, so it's not great for me to hardcode exact IP addresses/hosts with <code>--add-host</code>.</p>