diff --git a/libnetwork/store.go b/libnetwork/store.go index bacc6170ce..7bbb9aa1bb 100644 --- a/libnetwork/store.go +++ b/libnetwork/store.go @@ -367,6 +367,11 @@ func (c *controller) processEndpointDelete(nmap map[string]*netWatch, ep *endpoi c.Lock() if len(nw.localEps) == 0 { close(nw.stopCh) + + // This is the last container going away for the network. Destroy + // this network's svc db entry + delete(c.svcDb, ep.getNetwork().ID()) + delete(nmap, ep.getNetwork().ID()) } }