- Docker containers can only communicate with the host using the docker0 interface address, which from my understanding is the network bridge. The cleanest way of doing this is through the 'hosts' file. the IP can be taken running this command on a linux host:
ip route list dev docker0 | awk 'NR==1 {print $NF}'
. If it does not work, changingNR==1
toNR==2
may do the job. This can be added as an ENV variable for easily access. To add a new entry to the hosts file you need to add the--add-host=
argument to yourdocker run
command. e.g.docker run --add-host=hostip:$DOCKER_HOST_IP...
Python logging using YAML configuration is greatly limited. Its better to use the dict config if you wish to support custom handlers, etc. the YAML config can only get handlers that are in the current namespace. Which means, if you want to use any of the typical python handlers, you need to do
import logging.handlers
in the module that configures the logging from the YAML file which sucks. Use the dict config!