How to edit /etc/hosts file in running docker container
<p>I am working on an application which requires some  configuration to be stored in /etc/hosts file of a docker container.
I have tried it with many options but did not find any correct way of modifying the /etc/hosts file at run time.</p>

<p>I want to do it either by Dockerfile or by java code.
I am able to build the docker image and modify the /etc/hosts files manually, but unfortunately that is not our projects requirement.</p>