docker: Error response from daemon: driver failed programming external connectivity on endpoint redis

2.2k Views Asked by At

I'm trying to practice the example provided in the link https://docs.docker.com/engine/userguide/networking/work-with-networks/#connect-containers.

docker network create -o "com.docker.network.bridge.host_binding_ipv4"="172.23.0.1" my-network

$ docker network inspect my-network
  [
{
    "Name": "my-network",
    "Id": "90158e0c6f03a62f4852fcaa429f8a4d0df0e3c27f908500337e69b42d78c3a5",
    "Created": "2017-09-15T20:14:50.778210676Z",
    "Scope": "local",
    "Driver": "bridge",
    "EnableIPv6": false,
    "IPAM": {
        "Driver": "default",
        "Options": {},
        "Config": [
            {
                "Subnet": "172.23.0.0/16",
                "Gateway": "172.23.0.1"
            }
        ]
    },
    "Internal": false,
    "Attachable": false,
    "Ingress": false,
    "ConfigFrom": {
        "Network": ""
    },
    "ConfigOnly": false,
    "Containers": {},
    "Options": {
        "com.docker.network.bridge.host_binding_ipv4": "172.23.0.1"
    },
    "Labels": {}
}
 ]

Then the next docker command to run the redis on this network is giving me the error.

$docker run -d -P --name redis --network my-network redis

8a91f4a6e6a688173060ac20d71b461e13a7c7b7d6cbf1318d66114922e47357 docker: Error response from daemon: driver failed programming external connectivity on endpoint redis (4e8fad58239e5785f31c0c4e18a276f334410bcec3f9ecb6ec850d75e6120250): Error starting userland proxy: listen tcp 172.23.0.1:32787: bind: cannot assign requested address.

How this error can be resolved?

1

There are 1 best solutions below

0
On

Just to avoid headache , restart docker once and test it again