Docker:无法在要分配给网络的默认值中找到可用的,不重叠的IPv4地址池

问题描述 投票:9回答:1

当我尝试使用docker-compose部署我的应用程序时,我收到了以下错误:

Creating network "<myapplicationnamehere_mycustomnetwork>" with the 
default driver
could not find an available, non-overlapping IPv4 address pool among 
the defaults to assign to the network

现在我在这里和那里进行了一些研究,人们建议用docker network prune修剪未使用的旧码头网络。但是因为我运行了34个docker容器(我认为大约有30个网络),所以它只会在错误再次出现之前修剪一个或两个旧网络。

我的问题是:如何在不遇到docker网络分配问题的情况下确保运行多项服务。 (也许以某种方式创建更小的子网?)

我的Docker-compose文件的顶级网络部分如下所示:

#
# Networks section
# Networks:
# - public, represents the network between nginx and the public nginx-proxy (which should be already running)
# - uwsgi, represents the network between nginx and uwsgi
# - postgres, represents the network between uwsgi and postgres
#
networks:
  uwsgi:
  postgres:
  public:
    external:
      name: nginx-proxy
docker networking docker-compose docker-networking docker-network
1个回答
1
投票

您可以知道自Docker 18.06以来使用default-address-pool属性指定自定义地址范围。另见the associated Pull Request

© www.soinside.com 2019 - 2024. All rights reserved.