I am using docker to scale my service.
I know there's a command called
--add--host for adding host into /etc/host
However, I have a bunch of hosts need to be added. It's just too long to launch a docker in this way
docker run -it \
Therefore, I was thinking to create a function to read a mapping file and solve the problem.
The file format is like the following
I am new on shell script and have no idea to start with.