bnfinet / docker-dns Goto Github PK
View Code? Open in Web Editor NEWnodejs app to offer dns services based on a running docker enironment
License: MIT License
nodejs app to offer dns services based on a running docker enironment
License: MIT License
Hi Ben,
I'm getting the following error in the logs:
/opt/docker-dns/lib/docker-inspect.js:78 self.log.debug(self.name, "inspecting " + containers.length +" containers"); ^ TypeError: Cannot read property 'length' of null at /opt/docker-dns/lib/docker-inspect.js:78:55 at /opt/docker-dns/node_modules/dockerode/lib/docker.js:192:5 at Modem.buildPayload (/opt/docker-dns/node_modules/dockerode/node_modules/docker-modem/lib/modem.js:154:19) at ClientRequest.<anonymous> (/opt/docker-dns/node_modules/dockerode/node_modules/docker-modem/lib/modem.js:139:10) at ClientRequest.emit (events.js:95:17) at Socket.socketErrorListener (http.js:1551:9) at Socket.emit (events.js:95:17) at net.js:440:14 at process._tickCallback (node.js:419:13) [DD] info Loading config from /opt/docker-dns/config/config.js
My docker version is 1.3.2.
Greetings,
Alex
Hi, we're using docker-dns at Heyzap. After switching storage backends from devicemapper to aufs, we started rebuilding all our docker images. During this time, we saw this error in the docker-dns logfile:
[DD] error { [Error: HTTP code is 404 which indicates error: no such container - No such container: 7d5525f545e5da7589a3614697518d558c2641a27514fc93e78f9505a695cb05
]
reason: 'no such container',
statusCode: 404,
json: 'No such container: 7d5525f545e5da7589a3614697518d558c2641a27514fc93e78f9505a695cb05\n' }
[DD] warn 2fcd8d624604 could not find service name for 8125/udp on 2fcd8d624604
[DD] warn b541bbb4e787 could not find service name for 5671/tcp on b541bbb4e787
[DD] warn 7c077142e95c could not find service name for 5671/tcp on 7c077142e95c
[DD] warn 9f90d991847c could not find service name for 8125/udp on 9f90d991847c
/app/lib/container-inspect.js:102
self._buildAnCNAMERecords(self.ips.internal, self.docker.localfqdn, functi
^
TypeError: Cannot read property 'internal' of undefined
at /app/lib/container-inspect.js:102:39
at /app/node_modules/async/lib/async.js:570:21
at /app/node_modules/async/lib/async.js:249:17
at /app/node_modules/async/lib/async.js:125:13
at Array.forEach (native)
at _each (/app/node_modules/async/lib/async.js:46:24)
at async.each (/app/node_modules/async/lib/async.js:124:9)
at _asyncMap (/app/node_modules/async/lib/async.js:248:13)
at Object.map (/app/node_modules/async/lib/async.js:219:23)
at _parallel (/app/node_modules/async/lib/async.js:568:20)
Calling docker stop docker-dns
Calling docker rm docker-dns
Calling docker rm docker-dns
Calling docker build --rm -t local/docker-dns /etc/docker-dns
It looks like this error occurred 23 times in total.
A larger logfile snippet is available as a gist.
Version info:
root@monitor ~# docker info
Containers: 18
Images: 102
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 138
Execution Driver: native-0.2
Kernel Version: 3.13.0-40-generic
Operating System: Ubuntu 14.04.1 LTS
CPUs: 8
Total Memory: 14.69 GiB
Name: monitor.ec2.heyzap.com
ID: WLCE:UUI6:EJLL:L6ER:GMYE:TUGZ:BOHA:5KQJ:B6IL:SA77:DCBA:LMZ4
WARNING: No swap limit support
root@monitor ~# docker version
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef
root@monitor ~# nodejs --version
v0.10.25
I believe we're using master of docker-dns, because Dockerfile is doing a git clone of master, and we rebuilt the image right before this error occurred.
I personally am pretty unfamiliar with docker and docker-dns, so I can't promise to be helpful fixing this issue, I just thought you should know about it since there's at least a clear stacktrace to work with.
Disclaimer: I do not use the package, this was found during automated npm packages downloading.
Your current package size is 0.6 MiB packed, 82 MiB unpacked. 82 MiB of that are inside the docker/log
dir, files docker-dns.log.1
and docker-dns.log.2
. I suspect that this probably got packed to the release by mistake.
If you don't want to pack that directory and/or files, add them to the top-level .gitignore
.
Using Docker version 1.3.2, build 39fa2fa
docker pull bfoote/docker-dns
cd docker
cp ../config/config.js.example ./config/config.js
(edit some stuff)
./run_docker.sh hostname ./config/config.js;
Outpt
$ ./run_docker.sh hostname ./config/config.js; [master]
using config file ./config/config.js
docker-dns
docker-dns
docker run -d -t -h hostname --name docker-dns -p 172.17.42.1:53:53/udp -v /var/run/docker.sock:/var/run/docker.sock -v /home/cristian/.docker-dns/docker-dns/docker/log:/var/log/supervisor -v /home/cristian/.docker-dns/docker-dns/docker/./config/config.js:/opt/docker-dns/config/config.js bfoote/docker-dns
try this out to test if it worked:
dig -t SRV \* @172.17.42.1
dig -t SRV _domain._udp\* @172.17.42.1
logs are available at ./log/docker-dns.log
please send pulls and patches, especially to update
the config/etc-services file
Thanks!
ben
The logfile contains
[DD] info Loading config from /opt/docker-dns/config/config.js
/opt/docker-dns/lib/docker-inspect.js:78
self.log.debug(self.name, "inspecting " + containers.length +" containers");
^
TypeError: Cannot read property 'length' of null
at /opt/docker-dns/lib/docker-inspect.js:78:55
at /opt/docker-dns/node_modules/dockerode/lib/docker.js:192:5
at Modem.buildPayload (/opt/docker-dns/node_modules/dockerode/node_modules/docker-modem/lib/modem.js:154:19)
at ClientRequest.<anonymous> (/opt/docker-dns/node_modules/dockerode/node_modules/docker-modem/lib/modem.js:139:10)
at ClientRequest.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1551:9)
at Socket.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:419:13)
Node.js
version v0.11.14 (nvm install v0.11.14
)docker-dns
: npm install -g docker-dns
config.js
in working directorydocker-dns --config config.js
This is the error I get:
$ docker-dns --config
[...]
[DD] info docker-dns initialized
events.js:85
throw er; // Unhandled 'error' event
^
Error: bind EINVAL
at exports._errnoException (util.js:742:11)
at dgram.js:222:28
at dns.js:82:18
at process._tickCallback (node.js:372:11)
I can ping the the container by the generated url but I'm not able to login via SSH. Using the ip which I get from the ping works as expected.
ping nginx.local.docker
PING nginx.local.docker (92.242.140.2) 56(84) bytes of data.
I think 92.242.140.2 is the IP address of some router on my ISP's network (Cox). Why is docker-dns pointing there?
Can you Discribe a bit what this docker-dns can be used for? since docker it self offers linking of containers and so edits the /etc/hosts file there would be a simpl method to offer all services to a other container with simply linking it in or do i miss understand something?
$ docker-dns --config config.js
(node) util.puts is deprecated. Use console.log instead.
can't find config.js
undefined
Hi,
the problem is the following. The DNS server solves all addresses related to the docker containers but no others. So I'm able to access the other containers but apt-get update
for example will fail.
Greetings,
Alex
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.