How to configure docker to be able to have internet access via wireless connection?

sarslanhan picture sarslanhan · Jun 8, 2013 · Viewed 10.9k times · Source

I am trying to build a docker image by using the ones in the repository however i haven't been able to run 'apt-get update' 'apt-get install' commands because it seems that the container is not connected to the internet. I think the problem is caused by the fact that i am using a wireless connection. Is there a way to configure the docker or lxc to use the wireless network instead of the ethernet.

Answer

creack picture creack · Jun 8, 2013

I see two possibility:

1) Make sure your ip_forward is set to 1 (sysctl -w net.ipv4.ip_forward=1)

2) Make sure it is not a DNS issue: try docker run base ping google.com, if it does not work, you can set custom dns server: docker run -dns 8.8.8.8 base ping google.com.