Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
import json
import os
import shutil
import subprocess
import re
dockerdir = '/var/lib/docker'
volumesdir = os.path.join(dockerdir, 'volumes')
#!/usr/bin/env python
# Script to run dynamic dns for docker containers.
# DNS is served by dnsmasq running on the docker0 gateway ip, and dynamically
# updated at containers come and go.
#
# To use from docker, just provide the --dns option:
# docker run --dns <gateway> ...
# The gateway ip you need will be printed when this script is run.