The docker containers create their own internal IP addresses. These are bridged, however, when the slave container connects to the master, it gives the master this address as its' location. By default this is not visible to the master container (on another machine) and so the worker is not visible.
Some examples involve parsing the hosts file and so forth however, newer versions of Docker do not require this. It is possible instead to use the docker swarm functionality to effectively create dns entries for the containers and make them visible to each other without messing with the container itself. Note the steps below are for interactively running. The service docker-compose.yml will have to do some things differently, but will get to that later.