【问题标题】:DNS resolution inside an LXD container doesn't workLXD 容器内的 DNS 解析不起作用
【发布时间】:2017-01-05 09:44:32
【问题描述】:

我最近开始尝试使用 LXD 容器,但遇到了一个我似乎无法解决的基本障碍。

我无法在容器内运行和apt updated

ubuntu@dev:~$ lxc exec adil-php5 -- apt update
....
Err http://archive.ubuntu.com trusty Release.gpg
  Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com trusty-updates Release.gpg
  Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com trusty-backports Release.gpg
  Could not resolve 'archive.ubuntu.com'
Err http://security.ubuntu.com trusty-security Release.gpg
  Could not resolve 'security.ubuntu.com'
....

一篇文章建议切换到nictypemacvlan。那也没有帮助。我的货币“默认”配置文件是:

lxc profile show default
name: default
config: {}
description: Default LXD profile
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic

主机:ubuntu 16.04 容器:ubuntu 14.04

【问题讨论】:

  • 我敢打赌,您的容器 resolv.conf 没有使用可从您的主机访问的 DNS 服务器,或者是空的。

标签: linux containers lxc lxd


【解决方案1】:

如果您没有订阅 LXC 用户邮件列表,我建议您订阅。

LXD 开发人员和许多其他有经验的 LXD 用户每天都会观看该列表并回答有关 LXD 和 LXC 的问题...

https://lists.linuxcontainers.org/listinfo/lxc-users

【讨论】:

    猜你喜欢
    • 2014-08-19
    • 2017-08-09
    • 1970-01-01
    • 1970-01-01
    • 2020-11-08
    • 2015-07-11
    • 2021-04-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多