Adding hostname customization in docker-compose will break the container network if the following option is used in docker-compose in ROS application:
network_mode: "host"
The error is as follows:
RLException Unable to contact my own server at [http://docker:40287/].
This usually means that the network is not configured properly.
A common cause is that the machine cannot ping itself. Please check
for errors by running:
ping docker
For more tips, please see
http://www.ros.org/wiki/ROS/NetworkSetup