15

当我尝试使用 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
4

1 回答 1

1

自 Docker 18.06 起,您可以使用 default-address-pool 属性指定自定义地址范围。另请参阅 相关的 Pull Request

于 2018-09-14T11:16:02.100 回答