Comments (10)
Thanks for the report Alex,
How are you running docker-dns? Is it from the published docker container at https://registry.hub.docker.com/u/bfoote/docker-dns/ or is it from source here?
Could please you post your config file, your OS and in the case of the docker instance how you called docker run
?
from docker-dns.
Hi,
my config looks the following:
var config = {};
config.development = true;
config.debug = false;
// a fake top level domain
// appended to all generated hostnames
config.faketld = "local";
// frequency of dns entry refresh from docker containers
config.pollinterval = 17 * 1000;
// multiple dockers can be configured
// each one should gets it's own namespace
// hostname.publicname.faketld
config.dockers = [{
// for 'publicly' exposed ports
// when a service is offered on '0.0.0.0'
// this is the IP lookups will return
publicip: "10.20.0.100",
// the public name is to give this docker instance it's own namespace
publicname: "public.docker",
// the local name is to provide a namespace for routing 172.17.0.0 addresses
localname: "local.docker",
// dockerode config
// see: https://github.com/apocas/dockerode
// and http://docs.docker.io/en/latest/use/basics/#bind-docker
dockerode: {
socketPath: '/var/run/docker.sock'
}
}];
// node-named config
// see: https://github.com/trevoro/node-named
// bindip is for this container only, not docker-wide
config.node_named = {
port: 53,
bindip: '0.0.0.0'
};
module.exports = config;
I cloned the git repository form here (github) and used build_docker.sh (sudo ./build_docker.sh) and run_docker.sh (sudo ./run_docker.sh local config/config.js).
Edit: Os is Ubuntu 14.10 and I used the latest docker version from the docker repository not the Ubuntu one.
Greetings,
Alex
from docker-dns.
I've just cloned a fresh copy, built a fresh container and run it using your config and it worked well for me.
Could you try
docker rmi bnfinet/docker-dns
and then
run_docker.sh
That should pull a fresh container from docker hub.
since self.D.listContainers
is failing (a call into the dockerode
package) my guess is that it can't talk to the docker local api.
Does /var/run/docker.sock
exist?
Also, what OS/arch are your on? Ubuntu?
Cheers,
ben
Edit: just saw your edit wrt Ubuntu 14.10, thanks
from docker-dns.
I already tried that, but I have no bnfinet/docker-dns
image, instead of that I have bfoote/docker-dns
. /var/run/docker.sock
exists.
from docker-dns.
I also tried just now
echo -e "GET /images/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock
and got a valid json response.
from docker-dns.
If I install it directly on the host with npm it seems to work. Very strange... seems that the /var/run/docker.sock is not mapped correctly to the container or something like that.
from docker-dns.
I saw the permissions for docker.sock
had the permission srw-rw----
. I change it to srw-rw-rw-
but it didn't fixed it, but adding --privileged=true
to
CMD="docker run -d -t --privileged=true -h ${HOST} --name docker-dns ${BINDARG} -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}/log:/var/log/supervisor ${CONFARG} bfoote/docker-dns ";
at run_docker.sh
solved it.
In addition docker.socks
is owned by the group docker, but that should be the default.
from docker-dns.
aha! nice find
I was about to ask you to run
docker run --rm -i -t --name docker-dns-test -v /var/run/docker.sock:/var/run/docker.sock bfoote/docker-dns /bin/bash
and then once at the bash prompt run
echo -e "GET /images/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock
I'll document that here in case anyone else comes along.
I'd be curious to know if --privileged
is required if your user is part of the docker
group.
usermod -a -G docker ${USER}
newgrp docker
Thanks!
from docker-dns.
I notice that there was one question left. Yes my user is part of the docker group.
from docker-dns.
Thanks again Alex, closing this.
Please do let me know how it goes!
from docker-dns.
Related Issues (10)
- Hello my Frind HOT 1
- TypeError: Cannot read property 'internal' of undefined HOT 2
- Do not package logs
- can't find config.js
- DNS server doesn't solve all addresses HOT 1
- bind EINVAL error HOT 3
- TypeError: Cannot read property 'length' of null HOT 11
- does not point to localhost HOT 3
- Can ping url but not ssh to container HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-dns.