Skip to content

docker network rm <name> doesn't remove duplicate networks #33561

@larsnystrom

Description

@larsnystrom

Description

Due to #20648 docker sometimes creates duplicate networks with the same name. Running docker network rm <name> only removes one of them. This also affects docker-compose down, see docker/compose#4890.

Steps to reproduce the issue:

  1. Run docker-compose up <service1> & docker-compose up <service2>
  2. Check that there are two networks with docker network ls.
  3. docker network rm <network_name> will only remove one of the networks.

Describe the results you received:

docker network rm <network> removes one network with the specified name.

Describe the results you expected:

docker network rm <network> should remove all networks with the specified name.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Tue Mar 28 00:40:02 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Fri Mar 24 00:00:50 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 112
 Running: 4
 Paused: 0
 Stopped: 108
Images: 1568
Server Version: 17.03.1-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.27-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 6
Total Memory: 7.786 GiB
Name: moby
ID: PR5M:KFV7:C5HM:7FMM:MSVL:LZS2:BY6T:STVM:OUUU:4OTZ:KXAA:IE74
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 45
 Goroutines: 50
 System Time: 2017-06-07T08:23:56.16651591Z
 EventsListeners: 1
No Proxy: *.local, 169.254/16
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):

Running on docker for mac on macOS Sierra 10.12.5
Version 17.03.1-ce-mac12 (17661)
Channel: stable
d1db12684b

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions