Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comically small number of networks available in Docker For Mac #7270

Open
jaspertandy opened this issue May 1, 2024 · 2 comments
Open

Comically small number of networks available in Docker For Mac #7270

jaspertandy opened this issue May 1, 2024 · 2 comments

Comments

@jaspertandy
Copy link

Description

I've always had this issue with Docker for Mac where every now and again I need to clear out all my networks and start over, but it's happening increasingly often now, and has just happened to me today where I run a new docker compose up because I'm out of networks.

My networks:

~ > docker network ls
NETWORK ID     NAME       DRIVER    SCOPE
27f9b9d52378   REDACTED   bridge    local
35653444f797   REDACTED   bridge    local
62342258f4c9   REDACTED   bridge    local
c1b2681fc627   REDACTED   bridge    local
5377ff88dfb6   REDACTED   bridge    local
71826180339f   REDACTED   bridge    local
7d03dc42a8c3   REDACTED   bridge    local
5ce06468c994   REDACTED   bridge    local
7a2b85411b98   REDACTED   bridge    local
a8352dad0bae   REDACTED   bridge    local
f7a379308a0f   REDACTED   bridge    local
afec6569dd12   REDACTED   bridge    local
68730d3287ac   REDACTED   bridge    local
c962983e80cd   REDACTED   host      local
feb09544371b   REDACTED   bridge    local
79ff9b3b3de4   REDACTED   bridge    local
97f926deb5ab   REDACTED   bridge    local
4b6af8251762   REDACTED   bridge    local
db840dc45461   REDACTED   bridge    local
4eaf56560b2e   REDACTED   bridge    local
edc92d1a4c9a   REDACTED   bridge    local
ee8277913b99   REDACTED   bridge    local
9d1cbca59bcf   REDACTED   bridge    local
01612c5f82c5   REDACTED   bridge    local
ab0ec921f7de   REDACTED   bridge    local
c6962a921947   REDACTED   null      local
992e4edd0057   REDACTED   bridge    local
7e97010a45ac   REDACTED   bridge    local
6f47b655fcc2   REDACTED   bridge    local
f998ee6d6fa8   REDACTED   bridge    local
7355d4bf6880   REDACTED   bridge    local
cfe99de79a53   REDACTED   bridge    local
7a276d4da169   REDACTED   bridge    local

I've solved this previously with a docker system prune but I would prefer to solve this by setting my Resources > Network Docker subnet to something like 172.16.20.0/22. However, this field only seems to allow a /24 CIDR. What's going on here? This limitation is super annoying when you work in an agency with lots of projects.

Reproduce

  1. Use docker for Mac
  2. Have many projects
  3. Run out of networks
  4. Try to change config to allow yourself more networks

Expected behavior

I should be able to create many more networks.

docker version

Client:
 Cloud integration: v1.0.29
 Version:           20.10.21
 API version:       1.41
 Go version:        go1.18.7
 Git commit:        baeda1f
 Built:             Tue Oct 25 18:01:18 2022
 OS/Arch:           darwin/arm64
 Context:           desktop-linux
 Experimental:      true

Server: Docker Desktop 4.16.0 (92817)
 Engine:
  Version:          20.10.21
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.7
  Git commit:       3056208
  Built:            Tue Oct 25 17:59:41 2022
  OS/Arch:          linux/arm64
  Experimental:     true
 containerd:
  Version:          1.6.10
  GitCommit:        770bd0108c32f3fb5c73ae1264f7e503fe7b2661
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.9.1)
  compose: Docker Compose (Docker Inc., v2.13.0)
  dev: Docker Dev Environments (Docker Inc., v0.0.5)
  extension: Manages Docker extensions (Docker Inc., v0.2.16)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.22.0)

Server:
 Containers: 774
  Running: 0
  Paused: 0
  Stopped: 774
 Images: 1322
 Server Version: 20.10.21
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 770bd0108c32f3fb5c73ae1264f7e503fe7b2661
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 5
 Total Memory: 17.55GiB
 Name: docker-desktop
 ID: K5TE:Z2QI:GYNE:R56Y:WJFR:2PFX:5SCM:YAV7:KXPZ:3LJR:S5QL:YXA6
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

Diagnostics ID

0FCC5372-02A5-4C31-9906-384A4F1AEEE5/20240501133406

Additional Info

I know I'm on an older version of Docker for Mac but I am affected by this issue and can't upgrade until it's solved.

@akerouanton
Copy link
Member

@jaspertandy Thanks for reporting.

We recently discussed that internally and an Engine user also opened an issue to change the list of 'default address pools' (see moby/moby#47737) -- this would make more subnets available.

We want to merge another change first, and then we'll change that default value. This should be fixed in a few versions.

As a workaround, you can put this in your daemon.json (Settings > Docker Engine):

{
    "default-address-pools": [
        {"base": "172.16.0.0/16", "size": 24},
        {"base": "192.168.0.0/16", "size": 24}
    ]
}

@jaspertandy
Copy link
Author

@akerouanton thanks so much, and thank you for the temporary workaround. That's especially appreciated, as I mentioned I'm stuck on an older version so wouldn't be able to upgrade anyway. Really appreciate your quick reply on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants