linux - LXD 容器内的 DNS 解析不起作用

标签 linux containers lxc lxd

我最近开始尝试 LXD 容器,并遇到了一个我似乎无法修复的基本障碍。

我无法在容器内运行和apt更新

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'
....

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

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

最佳答案

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

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

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

关于linux - LXD 容器内的 DNS 解析不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41481668/

相关文章:

swift - 有没有办法获取容器的文本字段信息?

docker - 在构建docker时发生do_compile错误

linux - 如何在 linux 中查找并删除与名称不匹配的目录? !#Bash

docker - envsubst 命令卡在容器中

python - 如何在linux上的python中安装模块autopy?

css - 切换 div 下推其他 div

docker - 水平缩放如何减少系统负载?

lxc - 为什么 libvirtd 无法创建带有内部错误 'cpuacct'、 'devices' 和 'memory' cgroups Controller 的虚拟机?

linux - Linux 桥接器在 2 个 TAP 接口(interface)之间需要 IP 吗?

linux - bash : Replace entire line