1

Is it possible to modify MY /etc/hosts file when I run docker-compose up --build?

I came across the 'extra_hosts' flag but that appears to modify the hosts file of my containers rather than my host.

My goal is to loop through all my development vhosts and apply them to my vhost automagically so there is less manual updating I need to do.

JustPie
  • 21
  • 3
  • Not possible with standard instrumentation. Look for some third-party solutions. – anemyte Jan 15 '21 at 16:19
  • Thank you for the reply. I'll keep searching. – JustPie Jan 20 '21 at 17:52
  • 1
    No problem. Check this answer https://stackoverflow.com/questions/35828487/docker-1-10-access-a-container-by-its-hostname-from-a-host-machine/51125399#51125399 This isn't about modifying hosts file, but the goal is the same: to resolve container names from host. – anemyte Jan 20 '21 at 19:44

0 Answers0