dante-sever fail to bind ip by interface name in docker container

I try the docker recently, but the dante-server seem not to work.

Environment

os: gentoo x86_64
docker version:

  • Would Docker swarm assist me with managing containers with specific environment variables?
  • Kubernetes delete secret docker-registry error Unable to connect to the server: x509
  • is it possible to run shell script and then node app.js inside docker container
  • Docker container with filesystem encryption?
  • Run apache tomcat server in docker container
  • How can I use environment variables in a docker run command?
  • Client version: 1.1.0
    Client API version: 1.13
    Go version (client): go1.3
    Git commit (client): 79812e3
    Server version: 1.1.0
    Server API version: 1.13
    Go version (server): go1.3
    Git commit (server): 79812000
    

    DockerFile for customized image

    From centos:centos6
    
    RUN yum install -y curl
    
    RUN rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
    RUN rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
    
    
    RUN echo -e "[nginx]\nname=nginx repo\nbaseurl=http://nginx.org/packages/centos/6/\$basearch/\ngpgcheck=0\nenabled=1" > /etc/yum.repos.d/nginx.repo
    
    RUN yum install -y nginx tinyproxy dante-server mysql-server
    

    start container

    sudo docker run -i \
      --name="proxy" \
      -p 14000:3128 \
      -p 14001:4655 \
      -v ${confdir}/tinyproxy.conf:/etc/tinyproxy.conf \
      -v ${confdir}/dante-server.conf:/etc/sockd.conf \
      -v ${dantelogdir}:/var/log/socks \
      -v ${tinylogdir}:/var/log/tinyproxy \
      devel/centos6 /bin/bash -c "tinyproxy -c /etc/tinyproxy.conf;sockd -f /etc/sockd.conf"
    

    sockd configuration

    internal: eth0 port = 4655
    external: eth0
    
    logoutput: /var/log/socks/sockd.log
    socksmethod: none
    
    user.privileged: root
    user.notprivileged: root
    user.libwrap: root
    
    client pass {
        from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
        clientmethod: none # match all idented users that also are in passwordfile
    }
    
    socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
      socksmethod: none
    }
    

    The tinyproxy works well when i test it alone. The dante-server passes the configuration test, but log follow errors during the initiation:

    Aug 10 07:54:35 (1407653675.105641) sockd[12]: warning:
    bindinternal(): bind of address fe80::dc6f:d7ff:fe8f:fa59.46 55
    (address #2/2) for server to listen on failed: Cannot assign requested
    address Aug 10 07:54:35
    (1407653675.105650) sockd[12]: error: serverinit(): failed to bind
    internal addresses: Cannot assign requested address
    Aug 10 07:54:35 (1407653675.105672) sockd[12]: alert: mother[1/1]:
    shutting down

    The erros seems that dante-server can not bind to the ip resolved by the interface name **eth0*. Any help?

  • Using chef-zero + docker + kitchen with multiple nodes recipe
  • How to use docker deploy in docker-compose 3?
  • How to start a wide browser inside a docker container, for Protractor testing
  • File not getting updated when using “docker cp”
  • How can I change the default assigned ip address for docker containers?
  • Docker build Input/Output error
  • One Solution collect form web for “dante-sever fail to bind ip by interface name in docker container”

    I have been running into the same problem. It seems like there is a >1sec delay in eth0 being set up when a container starts.
    What I have done is add a sleep to the entrypoint / run like this:

    ENTRYPOINT sleep 2 && sockd
    

    It seems to solve all the problems I have been having.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.