Coder Social home page Coder Social logo

Error on startup about docker-dns HOT 10 CLOSED

bnfinet avatar bnfinet commented on June 27, 2024
Error on startup

from docker-dns.

Comments (10)

bnfinet avatar bnfinet commented on June 27, 2024

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.

GM-Alex avatar GM-Alex commented on June 27, 2024

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.

bnfinet avatar bnfinet commented on June 27, 2024

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.

GM-Alex avatar GM-Alex commented on June 27, 2024

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.

GM-Alex avatar GM-Alex commented on June 27, 2024

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.

GM-Alex avatar GM-Alex commented on June 27, 2024

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.

GM-Alex avatar GM-Alex commented on June 27, 2024

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.

bnfinet avatar bnfinet commented on June 27, 2024

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.

GM-Alex avatar GM-Alex commented on June 27, 2024

I notice that there was one question left. Yes my user is part of the docker group.

from docker-dns.

bnfinet avatar bnfinet commented on June 27, 2024

Thanks again Alex, closing this.

Please do let me know how it goes!

from docker-dns.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.