1
I have a bash script runmydocker.sh
whose goal is to retrieve the string sent by the user at the time he is calling this script and create a DNS on etc/hosts
.
Example:
The user (developer) will call runmydocker.sh mysitephp7.com
. This script will recover the string mysitephp7.com
and will insert it into /etc/hosts
as 127.0.0.1 mysitephp7.com
and then initialize the Docker.
Next when the developer writes to the browser url mysitephp7.com
the system would be loaded using the Docker server. Note that this DNS did not exist on hosts before the script.
All steps are ready except for inserting this string mysitephp7.com
.with no /etc/hosts.
what would be the proper way to achieve this?