Tiny python script to add ip and hostname of container in /etc/hosts.
Install docker-py
For debian :
sudo apt install cmake python-docker
wget https://github.com/RoPP/docker-aaiteh/archive/master.zip
unzip master.zip
cd docker-aaiteh-master
mkdir build
cd build
cmake ..
sudo make install
sudo systemctl enable docker-aaiteh.service
sudo systemctl start docker-aaiteh.service
Nothing to do. When you start a container, it should be added to your /etc/hosts file with his ip address. It should be removed when you stop it.
Enjoy :)