Ubuntu – Unable to install CURL on Docker Ubuntu image

curldockerUbuntu

I'm trying to install curl on ubuntu 14.04 in Docker image and the simple:

sudo apt-get update
sudo apt-get install curl

will never work with the following output. It seems that curl installation is impossible through apt-get on this Docker image. I will be thankful for any help as I'm new to running Docker.

Err http://archive.ubuntu.com trusty InRelease
Err http://archive.ubuntu.com trusty-updates InRelease
Err http://archive.ubuntu.com trusty-security InRelease
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-security Release.gpg
Could not resolve 'archive.ubuntu.com'
Reading package lists… Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/InRelease

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'archive.ubuntu.com'

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Could not resolve 'archive.ubuntu.com'

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Could not resolve 'archive.ubuntu.com'

W: Some index files failed to download. They have been ignored, or old ones used instead

Err http://archive.ubuntu.com/ubuntu/ trusty/main libkeyutils1 amd64 1.5.6-1
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty/main libidn11 amd64 1.28-1ubuntu2
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty/main librtmp0 amd64 2.4+20121230.gitdf6c518-1
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main libkrb5support0 amd64 1.12+dfsg-2ubuntu5.2
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main libk5crypto3 amd64 1.12+dfsg-2ubuntu5.2
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main libkrb5-3 amd64 1.12+dfsg-2ubuntu5.2
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main libgssapi-krb5-2 amd64 1.12+dfsg-2ubuntu5.2
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main libcurl3 amd64 7.35.0-1ubuntu2.5
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main ca-certificates all 20141019ubuntu0.14.04.1
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main krb5-locales all 1.12+dfsg-2ubuntu5.2
Could not resolve 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main curl amd64 7.35.0-1ubuntu2.5
Could not resolve 'archive.ubuntu.com'
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb5support0_1.12+dfsg-2ubuntu5.2_amd64.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/k/krb5/libk5crypto3_1.12+dfsg-2ubuntu5.2_amd64.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/k/keyutils/libkeyutils1_1.5.6-1_amd64.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb5-3_1.12+dfsg-2ubuntu5.2_amd64.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/k/krb5/libgssapi-krb5-2_1.12+dfsg-2ubuntu5.2_amd64.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libi/libidn/libidn11_1.28-1ubuntu2_amd64.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/r/rtmpdump/librtmp0_2.4+20121230.gitdf6c518-1_amd64.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/c/curl/libcurl3_7.35.0-1ubuntu2.5_amd64.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/c/ca-certificates/ca-certificates_20141019ubuntu0.14.04.1_all.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/k/krb5/krb5-locales_1.12+dfsg-2ubuntu5.2_all.deb Could not resolve 'archive.ubuntu.com'

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.35.0-1ubuntu2.5_amd64.deb Could not resolve 'archive.ubuntu.com'

E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?

Best Answer

It seems like you can't access those resources because the DNS are not configured. Check if you have access to them (ping 8.8.8.8) and then configure the DNS for the docker (adding nameserver 8.8.8.8 to /etc/resolv.conf).

Regards