跳至主要内容

博文

目前显示的是标签为“bridge”的博文

(migrated)docker容器无法访问网络

 现象 1. 最初始现象是发现docker容器里使用apt-get更新(update)时失败, 由于容器里没有ping等一系列工具软件, 无法确认问题具体情况 2. 接着就找image里有ping的包, 用docker search发现pentest-tools里有, 但pull下来后发现运行错误, 报错信息如下: standard_init_linux.go:211: exec user process caused "exec format error" 查了下, 有人说是因为不兼容引起的错误:  docker运行容器报错standard_init_linux.go:211: exec user process caused “exec format error“的可能解决办法 3. 在查找中突然发现有说centos的image里有ping, 想着操作系统可能都会有整套网络工具软件, 就找了个ubutu的包pull下来, 结果里面还是没有.     虽然centos不熟, 都是linux应该也差不太多, 回头就pull了centos.      用docker运行并进入到容器里 #  docker run -it centos /bin/bash [root@a688b8f2101e /]# ping 192.168.1.1 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. ^C --- 192.168.1.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 26ms [root@a688b8f2101e /]# ping 192.168.1.7 PING 192.168.1.7 (192.168.1.7) 56(84) bytes of data. 64 bytes from 192.168.1.7: icmp_seq=1 ttl=64 time=0.361 ms [root@a688b8f2101e /]# ping www.sina.com PING spool.grid.sinaedge.com (123....