For full description and information please check the repository documentation.
Docker-spy provides a DNS service based on Docker container events. It keeps an in-memory database of records that map container hostnames to ip addresses. When containers are start/stopped/destroyed it keeps track of their location.
It is specifically targeted at small local development environments where you want an easy way to connect with your containers.
Docker-spy can be configured through a number of environment variables:
- DNS_BIND: the address that the DNS server will bind to. Defaults to '0.0.0.0'.
- DNS_PORT: the port on which the DNS server will be reachable (tcp/udp). Defaults to '53'
- DNS_RECURSOR: the recursor to use when DNS requests are made to non-local addresses. Defaults to '220.127.116.11' from the Dockerfile
- DNS_DOMAIN: the domain that docker-spy should consider local and keep records for. Defaults to 'localdomain'
- DOCKER_HOST: the location of the Docker daemon. Defaults to the DOCKER_HOST environment variable or, if the DOCKER_HOST environment variable is not set, unix:///var/run/docker.sock. Setting this explicitly allows you to override the location.
Docker-spy can be started with the following command (using all defaults, add any environment settings that you wish to change):
docker run -p 53:53/udp -p 53:53 -v /var/run/docker.sock:/var/run/docker.sock iverberk/docker-spy
This maps the Docker socket as a volume in the container so that events may be tracked and it publishes port 53 on udp/tcp to the host