dotcloud/docker — pull request #7145 by zhongyi-altiscale (2014-07-21 23:16:24+00:00)
Title: docker issue 6935: allow 'docker run' to specify ipaddress associated with hostname

the format for specifying the ipaddress is
-h [hostname][:ipaddress]
for example,
bundles/1.1.1-dev/binary/docker-1.1.1-dev run -it -h abcdefg:1.2.3.4 ubuntu:14.04 bash
will create a container with host name of abcdefg and /etc/hosts will contain a line of
1.2.3.4 abcdefg

the current impl only parses the ipaddress to make sure it contains the correct format, and it is the caller's responsibility to make sure the ipaddress is valid and reachable