In a compose file I have a section that provides extra_hosts. These entries go into the /etc/hosts file of the containers started by the compose up. If the IP address of any of the external hosts changes, I would like to get the /etc/hosts files of all containers updated. Currently I have to update the extra_hosts section and then restart the containers using docker-compose down and up.
Is it possible to get the compose file changes reflected in the container’s /etc/hosts file without restarting the containers?