docker网络错误(network bridge not found)_docker 网桥丢失_临江仙我亦是行人的博客-CSDN博客

问题:docker 没有网络模型了

root@sh-gpu102:~# docker run -it -d -v /mnt:/mnt -v /ssd:/ssd registry.test.cn/more/lite:2.7.0.1542.4e07369
dece9b6df7a13285a53877dc016f518a7657abbe9c03c861a34ec1472b7789b3
docker: Error response from daemon: network bridge not found.
root@sh-gpu102:~# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
root@sh-gpu102:~#

重启大法

root@sh-gpu102:~# systemctl restart docker

不好使 ?

root@sh-gpu102:~# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
root@sh-gpu102:~#

只能自定义网桥了

root@sh-gpu102:~# docker network create --driver bridge --subnet 172.200.0.0/16 --gateway 172.200.0.1 ai-bridge
9029d91739e65fde98bf737e615ec484410370c74ee7582ed6727c7dad4517dd
root@sh-gpu102:~# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
9029d91739e6        ai-bridge        bridge              local

创建容器

root@sh-gpu102:~ 
b0ca771aa2cf1945e469c835b43beb0e3ca279867a20e9035fa218ec04ee65f8
 
root@sh-gpu102:~ 
b0ca771aa2cf        registry.test.cn/more/lite:2.7.0.1542.4e07369   

"/bin/bash"

About a minute ago Up About a minute brave_galois root@sh-gpu102:~ root@b0ca771aa2cf:~/body_front PING www.a.shifen.com

(

220.181.38.149

)

56

(

84

)

bytes of data. 64 bytes from 220.181.38.149

(

220.181.38.149

)

: icmp_seq

=

1 ttl

=

47 time

=

2.19 ms 64 bytes from 220.181.38.149

(

220.181.38.149

)

: icmp_seq

=

2 ttl

=

47 time

=

2.07 ms 64 bytes from 220.181.38.149

(

220.181.38.149

)

: icmp_seq

=

3 ttl

=

47 time

=

2.05 ms 64 bytes from 220.181.38.149

(

220.181.38.149

)

: icmp_seq

=

4 ttl

=

47 time

=

2.17 ms 64 bytes from 220.181.38.149

(

220.181.38.149

)

: icmp_seq

=

5 ttl

=

47 time

=

2.04 ms ^C --- www.a.shifen.com

ping

statistics --- 5 packets transmitted, 5 received, 0% packet loss,

time

4004ms rtt min/avg/max/mdev

=

2.040/2.108/2.194/0.080 ms root@b0ca771aa2cf:~/body_front

有一个缺点就是,必须指定网络模型,虽说 bridge 是 docker 的默认网络模型,但是自定义的显然没有取代 docker 默认的 bridge

root@sh-gpu102:~# docker run -it -d -v /mnt:/mnt -v /ssd:/ssd registry.test.cn/more/lite:2.7.0.1542.4e07369
dd6d3102d1156253dcb6221087dd3799efaeff9b46873d19fb6b1eeda17b93e0
docker: Error response from daemon: network bridge not found.
root@sh-gpu102:~#

至于为什么没有网络模型了,此问题没有找到根本原因,只能等待以后再查了