Docker контейнер нет интернета

Not able to access internet inside docker windows container

I am working on a corporate network and I tried setting proxy using RUN netsh winhttp set proxy proxy-server=»http://proxy.com:80″ bypass-list=»*.xyz.com» and also imported the registry HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings ipconfig /all inside my container gives below result

Windows IP Configuration Host Name . . . . . . . . . . . . : 0d5119fe9ce4 Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No Ethernet adapter Ethernet: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter Physical Address. . . . . . . . . : 00-15-5D-B4-55-54 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fd80::a1f4:ab74:983:af83%4(Preferred) IPv4 Address. . . . . . . . . . . : 172.xxx.xxx.xx(Preferred) Subnet Mask . . . . . . . . . . . : 255.xxx.xxx.xx Default Gateway . . . . . . . . . : 172.xxx.xxx.xx DHCPv6 IAID . . . . . . . . . . . : 67114333 DHCPv6 Client DUID. . . . . . . . : 00-01-40-01-25-D1-CB-C4-00-15-5D-D4-A5-54 DNS Servers . . . . . . . . . . . : 172.xxx.xxx.xx 10.xxx.xxx.xx NetBIOS over Tcpip. . . . . . . . : Disabled 

I suspect there is some dns/firewall issue or not setting proxy in a correct way. Can someone help me in identifying the root cause and fixing this issue.

Источник

No internet connection inside Docker containers

docker run ubuntu /bin/echo 'Hello world' 
docker run ubuntu apt-get update Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease Temporary failure resolving 'archive.ubuntu.com' Err:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'archive.ubuntu.com' 

Similar with pip and ping . I am on Ubuntu 16.04 and not using firewall or corporate proxy server and have tried to restart Docker. Upd: Update in interactive mode fails in the same fashion.

docker exec -ti angry_goodall /bin/bash apt-get update #fails ping google.com #fails with "unknown host" message ping 8.8.8.8 # shows PING 8.8.8.8 (8.8.8.8): 56 data bytes # and than hangs indefinetly 

sudo apt-get update runs successfully on host, i.e. on my computer outside docker. Upd Docker version 1.12.1, build 23cf638

Читайте также:  Домашняя сеть интернет своими руками

Источник

Docker container can only access internet with —net=host

Nothing has worked so far save for adding —net=host to the run command, but I can’t build images from a Dockerfile because I can’t use —net=host with the build command.

I ran docker network inspect bridge to checkout the settings for the docker network bridge and noticed that it uses (almost) the same subnet and gateway as my work VPN. Could that be causing an issue? That could also explain why when I connect to my work VPN some of the sites do not load.

This is the result from docker network inspect bridge :

docker0 Link encap:Ethernet HWaddr 02:42:9a:29:4a:c2 inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0 inet6 addr: fe80::42:9aff:fe29:4ac2/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:36 errors:0 dropped:0 overruns:0 frame:0 TX packets:55 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:2080 (2.0 KB) TX bytes:8498 (8.4 KB) enx00e09f0004bd Link encap:Ethernet HWaddr 00:e0:9f:00:04:bd UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:70948 errors:0 dropped:1 overruns:0 frame:0 TX packets:14839 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14270948 (14.2 MB) TX bytes:3460691 (3.4 MB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:3407 errors:0 dropped:0 overruns:0 frame:0 TX packets:3407 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:326405 (326.4 KB) TX bytes:326405 (326.4 KB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.17.62.55 P-t-P:172.17.62.55 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1406 Metric:1 RX packets:18 errors:0 dropped:0 overruns:0 frame:0 TX packets:21 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:500 RX bytes:1773 (1.7 KB) TX bytes:1466 (1.4 KB) wlp6s0 Link encap:Ethernet HWaddr cc:3d:82:1a:1e:1d inet addr:10.250.9.73 Bcast:10.250.9.255 Mask:255.255.254.0 inet6 addr: fe80::ce3d:82ff:fe1a:1e1d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4381 errors:0 dropped:0 overruns:0 frame:0 TX packets:4398 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2246805 (2.2 MB) TX bytes:835572 (835.5 KB) 

Источник

Оцените статью
Adblock
detector