Docker Community Forums

Share and learn in the Docker community.

Iptables failed


(Andyqu) #1

Expected behavior

Start a container successfully, using groovy client https://github.com/gesellix/docker-client

Actual behavior

Often encounter below problem when trying to start a container via groovy client lib:

de.gesellix.docker.client.DockerResponse(status:[text:Internal Server Error, code:500, success:false], headers:Content-Length: 419 Content-Type: application/json Date: Tue, 12 Jul 2016 02:48:01 GMT Server: Docker/1.12.0-rc3 (linux) , contentType:application/json, mimeType:application/json, contentLength:419, stream:null, content:[message:driver failed programming external connectivity on endpoint anony-WebHiveSql_master (50070d9139a670a89d21b7c617156e9d382ea858604b4976fef00b32897e84db): iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 20000 -j DNAT --to-destination 172.17.0.2:8080 ! -i docker0: Fatal error: exception Unix.Unix_error(Unix.ENOTCONN, “open”, “/var/log/service-port-opener.log”) (exit status 2)])

Information

-OS X: version
10.11.6 (build: 15G31)

  • UUID
    CE34E667-8178-46C0-B3C9-57917D6BD05D

  • Dockerfile
    https://github.com/AndyQu/docker_host_env/blob/master/Dockerfile

  • container configuration Json
    {
    “Cmd”: [
    "/sbin/init"
    ],
    “Image”: “deploy_img:1.0”,
    “Mounts”: [
    {
    “Source”: “/tmp/docker-deploy/anony-WebHiveSql_master//scripts”,
    “Destination”: “/scripts”,
    “RW”: true
    },
    {
    “Source”: “/tmp/docker-deploy/anony-WebHiveSql_master//web-hive-sql”,
    “Destination”: “/tmp/logs/web-hive-sql/”,
    “RW”: true
    },
    {
    “Source”: “/Users/andy/.gradle/”,
    “Destination”: “/root/.gradle/”,
    “RW”: true
    },
    {
    “Source”: “/Users/andy/.ssh/”,
    “Destination”: “/root/.ssh”,
    “RW”: true
    }
    ],
    “ExposedPorts”: {
    “8080/tcp”: {
    }
    },
    “HostConfig”: {
    “Binds”: [
    "/tmp/docker-deploy/anony-WebHiveSql_master//scripts:/scripts",
    "/tmp/docker-deploy/anony-WebHiveSql_master//web-hive-sql:/tmp/logs/web-hive-sql/",
    "/Users/andy/.gradle/:/root/.gradle/",
    "/Users/andy/.ssh/:/root/.ssh"
    ],
    “PortBindings”: {
    “8080/tcp”: [
    {
    “HostPort”: “20000”
    }
    ]
    }
    },
    “Tty”: true
    }