Docker “ERROR: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network”

前端 未结 19 599
别那么骄傲
别那么骄傲 2020-12-12 10:48

I have a directory apkmirror-scraper-compose with the following structure:

.
├── docker-compose.yml
├── privoxy
│   ├── config
│   └── Dockerfil         


        
相关标签:
19条回答
  • 2020-12-12 11:12

    I had the same error, but in my case, it was because I had too many containers running (about 220).

    0 讨论(0)
  • 2020-12-12 11:14

    Following Peter Hauge's comment, upon running docker network ls I saw (among other lines) the following:

    NETWORK ID          NAME                                    DRIVER              SCOPE
    dc6a83d13f44        bridge                                  bridge              local
    ea98225c7754        docker_gwbridge                         bridge              local
    107dcd8aa889        host                                    host                local
    

    The line with NAME and DRIVER as both host seems to be what he is referring to with "networks already created on your host". So, following https://gist.github.com/bastman/5b57ddb3c11942094f8d0a97d461b430, I ran the command

    docker network rm $(docker network ls | grep "bridge" | awk '/ / { print $1 }')
    

    Now docker-compose up works (although newnym.py produces an error).

    0 讨论(0)
  • 2020-12-12 11:18

    I fixed this issue by steps :

    1. turn off your network (wireless or wired...).

    2. reboot your system.

    3. before turning on your network on PC, execute command docker-compose up, it's going to create new network.

    4. then you can turn network on and go on ...

    0 讨论(0)
  • 2020-12-12 11:22

    You can try

    $sudo service network-manager restart
    

    Worked for me.

    0 讨论(0)
  • 2020-12-12 11:24

    I ran in this problem with OpenVPN working as well and I've found a solution where you should NOT stop/start OpenVPN server.

    Idea that You should specify what exactly subnet you want to use. In docker-compose.yml write:

    networks:
      default:
        driver: bridge
        ipam:
          config:
            - subnet: 172.16.57.0/24
    

    That's it. Now, default network will be used and if your VPN did not assign you something from 172.16.57.* subnet, you're fine.

    0 讨论(0)
  • 2020-12-12 11:25

    This happened to me because I was using OpenVPN. I found a way that I don't need to stop using the VPN or manually add a network to the docker-compose file nor run any crazy script.

    I switched to WireGuard instead of OpenVPN. More specifically, as I am running the nordvpn solution, I installed WireGuard and used their version of it, NordLynx.

    0 讨论(0)
提交回复
热议问题