如何配置docker能够通过无线连接上网吗? [英] How to configure docker to be able to have internet access via wireless connection?

查看:298
本文介绍了如何配置docker能够通过无线连接上网吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过使用存储库中的那些来构建一个码头服务器映像,但是我无法运行apt-get update'apt-get install'命令,因为它似乎容器没有连接到互联网。我认为问题是由于我正在使用无线连接的事实。有没有办法配置docker或lxc来使用无线网络而不是以太网。

解决方案

我看到两种可能性:



1)确保您的ip_forward设置为1( sysctl -w net.ipv4.ip_forward = 1



2)确保它不是DNS问题:尝试 docker run base ping google.com ,如果不工作,您可以设置自定义dns服务器: docker run -dns 8.8.8.8 base ping google.com


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.

解决方案

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.

这篇关于如何配置docker能够通过无线连接上网吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆