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.
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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…