我是LXC的新手。我尝试使用命令
创建ubuntu容器lxc-create -n onos -t ubuntu
安装运行了一段时间,并且卡在下面的消息
Installing Update
Connecting to archive.ubuntu.com
我支持公司代理。 Apt-get更新在主机中正常工作。但是当我尝试创建一个ubuntu容器时,我遇到了上述问题。
有没有人遇到过类似的问题。请帮忙。
答案 0 :(得分:0)
您应该在lxc-create之前使用代理:
export http_proxy="http://$pre$server:$port/"
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export FTP_PROXY=$http_proxy
export RSYNC_PROXY=$http_proxy
lxc-create -n onos -t ubuntu
您也可以为apt设置代理:
#cat /etc/apt/apt.conf.d/30proxy
Acquire::http::proxy "http://proxy:4128";
Acquire::https::proxy "https://proxy:4128";
PS:
bug lxc-create doesn't take advantage of the apt proxy
Here: lxc-create not working behind proxy解决方案是:
apt没有问题,但是我有使用debootstrap的问题。有 在/ etc / wgetrc中设置代理设置。一切都很好。