Hi,
I browsed tirelessly through the forums to try and find a way to link up containers that communicate with each other, but was disappointed to see that the preferred solution was dropping files into directories shared between containers. I wasn't satisfied with this approach and decided to find a way to link the containers so that data can be exchanged between them via network communication, like it should be. So without much further ado, here is a quick overview of how I linked up SickBeard container with NZBGet so that it can pass NZB files to it directly:
Forget the silly text, I used localhost instead of docker host's hostname, but here's a guide to linking containers either way
Step 1 - Add instruction to link SickBeard to NZBget in the unRAID webGUI
The command is
--link <container name to link with>:<alias>
Remember the alias because you will need it for...
Step 2 - Refer to the NZBGet container in SickBeard
When you perform the linking, docker will create some environment variables that specify which IP address was linked under, and what ports are available. In addition to this, it will also create a hostname in the container you created the link from, that maps alias from the --link command to the internal IP given to the container you linked to. This is probably best seen rather than explained:
root@Tower:/mnt# docker exec -i -t e0c4109fc635 bash
root@e0c4109fc635:/# cat /etc/hosts
172.17.0.25 e0c4109fc635
ff02::2 ip6-allrouters
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
172.17.0.11 nzbget
Note the last line! We can now use this to refer to the target container directly, like so:
And voila! You're done.
It would be nice if there was some sort of a "helper" page in the webGUI to achieve this, but this approach isn't too bad.