docker run --add-host myhost:192.168.1.5 myimage

Category: Docker

docker run --add-host myhost:192.168.1.5 myimage

Add a custom /etc/hosts entry inside the container

Adds a custom entry to the container's /etc/hosts file, mapping a hostname to an IP address.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.