docker run --add-host="app-backend:10.15.1.24" awesome-app
This command adds an entry to the container's /etc/hosts
file, which follows the format --add-host <name>:<address>
. In this example, the name app-backend
will resolve to 10.15.1.24
. This is particularly useful for tying disparate app components together programmatically.