diff options
author | Casey Deccio <casey@deccio.net> | 2019-01-21 17:55:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-21 17:55:58 +0300 |
commit | 44094e1055b79fc14f29108c71dddc7533f30013 (patch) | |
tree | 530abf2821936a301ad8eec3f17f2906cb198ff1 | |
parent | 3b42c7a3f10a7cabf96b588f48fd960af0a9d45b (diff) | |
parent | 9964eb9330faa2bb2d4b41608e626fd829f7877c (diff) |
Merge pull request #48 from tomaskrizek/docker
python3-based docker image
-rw-r--r-- | Dockerfile | 13 | ||||
-rw-r--r-- | README.md | 52 |
2 files changed, 65 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dc6a0d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM alpine:edge + +RUN apk add python3 graphviz ttf-liberation libsodium bind bind-tools +RUN apk add --virtual builddeps linux-headers python3-dev graphviz-dev gcc libc-dev openssl-dev swig && \ + pip3 install pygraphviz m2crypto dnspython libnacl && \ + apk del builddeps + +COPY . /tmp/dnsviz +RUN cd /tmp/dnsviz && python3 setup.py build && python3 setup.py install + +WORKDIR /data +ENTRYPOINT ["/usr/bin/dnsviz"] +CMD ["help"] @@ -469,3 +469,55 @@ $ dnsviz probe -A \ -D example.com:dsset-example.com. \ example.com ``` + + +## Docker container + +Ready to use docker container is available for use. + +``` +docker pull dnsviz/dnsviz +``` + +This section only covers Docker-related examples, for more information see the +Usage section. + +### Simple usage + +``` +$ docker run dnsviz/dnsviz help +$ docker run dnsviz/dnsviz query example.com +``` + +### Working with files + +It might be useful to mount a local working directory into the container, +especially when combining multiple commands or working with zone files. + +``` +$ docker run -v "$PWD:/data:rw" dnsviz/dnsviz probe dnsviz.net > probe.json +$ docker run -v "$PWD:/data:rw" dnsviz/dnsviz graph -r probe.json -T png -O +``` + +### Using host network + +When running authoritative queries, a host network mode is recommended. + +``` +$ docker run --network host dnsviz/dnsviz probe -4 -A example.com > example.json +``` + +Otherwise, you're likely to encounter the +`dnsviz.query.SourceAddressBindError: Unable to bind to local address (EADDRNOTAVAIL)` +error. + +### Interactive mode + +When doing complex analysis, where you need to run multiple dnsviz commands, +use bash redirection etc., it might be useful to run the container +interactively. + +``` +$ docker run --network host -v "$PWD:/data:rw" --entrypoint /bin/sh -ti dnsviz/dnsviz +/data # dnsviz --help +``` |