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

限于喜欢 提交于 2020-01-01 08:44:42

问题


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.


回答1:


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.




回答2:


I've had issues on Mint 15 (based on Ubuntu 13.04) which sound exactly like this. For me, the problem appeared after getting out of suspend. While my system had internet access, the docker containers did not. For me, a restart did the trick, but creacks solution might have worked as well...



来源:https://stackoverflow.com/questions/17002663/how-to-configure-docker-to-be-able-to-have-internet-access-via-wireless-connecti

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!