Can somebody help me get apt-get working in my docker container? Whenever I try running any apt-get command in my docker container, the command fails. I'm running Docker version 1.1.1, build bd609d2 on ubuntu 12.04.
When I do
$ sudo docker run -i -t ubuntu:14.04 /bin/bash
# apt-get update
I get errors saying
Could not resolve 'archive.ubuntu.com'
I tried uncommenting the line below in /etc/default/docker
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
but I still can't ping google.com
ping: unknown host
I confirmed that the container is using the dns servers 8.8.8.8 and 8.8.4.4
root@0baa87fc6322:/# cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
and I'm able to ping both servers so I'm pretty sure that a firewall isn't just dropping my packets.
Any help with this would be appreciated!
Thanks!
question from:
https://stackoverflow.com/questions/24832972/docker-apt-get-update-fails 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…