# 守护进程响应错误：端点名称 container_name 已存在于网络 bridge 中

- **ID:** `docker/container-name-orphaned-network-endpoint`
- **领域:** docker
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

容器从网络中断开时未正确移除端点，导致网络内部状态中残留了过期的端点条目。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Docker 20.10.17 | active | — | — |
| Docker 24.0.6 | active | — | — |
| Docker 25.0.0 | active | — | — |

## 解决方案

1. ```
   使用 'docker network disconnect -f bridge container_name' 显式断开容器与网络的连接，以移除过期的端点。
   ```
2. ```
   如果容器已不存在，使用 'docker network prune' 清理所有未使用的网络及其孤立的端点。
   ```
3. ```
   使用 'docker network inspect bridge' 检查网络端点列表，然后通过 'docker network disconnect -f bridge <container_id>' 手动断开每个过期的容器。
   ```

## 无效尝试

- **** — Restarting Docker does not clean up stale endpoints in individual networks; it only resets the daemon state but persistent network data remains. (70% 失败率)
- **** — The 'bridge' network is a default network that cannot be removed; this command will fail with 'Error response from daemon: network bridge is a pre-defined network'. (90% 失败率)
- **** — The container may already be removed, but the stale endpoint persists; force removal does not clean up orphaned endpoints in the network. (60% 失败率)
