创建容器:docker create  --name=mysqltest11  -v /soft11:/var/lib/mysql -p 3311:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:latest 

启动容器:docker start mysqltest11时报错,tail -f /var/log/message 查看报错信息如下:

un  8 10:59:21 localhost libvirtd: 2020-06-08 14:59:21.581+0000: 9445: error : virNetDevGetLinkInfo:2552 : unable to read: /sys/class/net/veth41d82e4/operstate: No such file or directory
Jun  8 10:59:21 localhost kernel: docker0: port 1(veth5f1fc46) entered disabled state
Jun  8 10:59:21 localhost kernel: docker0: port 1(veth5f1fc46) entered disabled state
Jun  8 10:59:21 localhost avahi-daemon[8741]: Withdrawing address record for fe80::9cd2:3eff:fee1:d640 on veth5f1fc46.
Jun  8 10:59:21 localhost avahi-daemon[8741]: Withdrawing workstation service for veth64d45e3.
Jun  8 10:59:21 localhost kernel: device veth5f1fc46 left promiscuous mode
Jun  8 10:59:21 localhost kernel: docker0: port 1(veth5f1fc46) entered disabled state
Jun  8 10:59:21 localhost avahi-daemon[8741]: Withdrawing workstation service for veth5f1fc46.
Jun  8 10:59:21 localhost NetworkManager[8870]: <info>  [1591628361.6579] device (veth5f1fc46): released from master device docker0
Jun  8 10:59:21 localhost journal: Removing a network device that was not added
Jun  8 10:59:21 localhost libvirtd: 2020-06-08 14:59:21.677+0000: 9445: error : virFileReadAll:1460 : Failed to open file '/sys/class/net/veth64d45e3/operstate': No such file or directory
Jun  8 10:59:21 localhost libvirtd: 2020-06-08 14:59:21.678+0000: 9445: error : virNetDevGetLinkInfo:2552 : unable to read: /sys/class/net/veth64d45e3/operstate: No such file or directory

 

试了很多次以为是docker bug,也查了百度上的,就一个答案,说是bug。我开始怀疑是bug,然后我把系统内核从3.1升级到5.9,然后再运行,发现还是不行。然后看报错以为是我的workstation出问题了,删了网卡重新连也不行。折腾了好久

最后发现了一个不一样。docker create -it 中-it参数少了。我用docker run -it创建容器的时候就是正常的。

我估计是这个原因。

百度上的唯一能搜到的那个解决方法太烦了。也没看懂。

故障现象一样,可能故障原因各有不同,仅写出来给大家分享。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐