I know this question have been asked at several other places too but I have read most of those posts but still can't figure out solution for my problem here. I am trying to execute apt-get update
command in my Ubuntu image created by Docker for Windows. Here are the steps I followed:
- Pulled an image of Ubuntu 14.04 and ran it.
- Then attached my image to a container and then ran it to open the Ubuntu terminal.
In terminal, I am trying to do
`apt-get update'
but it fails with below message:
Err http://archive.ubuntu.com trusty InRelease
Err http://archive.ubuntu.com trusty-updates InRelease
Err http://archive.ubuntu.com trusty-backports InRelease
Err http://archive.ubuntu.com trusty Release.gpg
Unable to connect to archive.ubuntu.com:http: [IP: 99.999.99.999.99]
Err http://archive.ubuntu.com trusty-updates Release.gpg
Unable to connect to archive.ubuntu.com:http: [IP: 99.999.99.999.99]
Err http://archive.ubuntu.com trusty-backports Release.gpg
Unable to connect to archive.ubuntu.com:http: [IP: 99.999.99.999.99]
Err http://security.ubuntu.com trusty-security InRelease
Err http://security.ubuntu.com trusty-security Release.gpg
Unable to connect to security.ubuntu.com:http: [IP: 99.100.99.100.99]
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-backports/InRelease
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 99.999.99.999.99]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 99.999.99.999.99]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 99.999.99.999.99]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Unable to connect to security.ubuntu.com:http: [IP: 99.100.99.100.99]
W: Some index files failed to download. They have been ignored, or old ones used instead.
I looked up to various solutions that people have mentioned on this community and a handful of others as well, but no luck. I referred to this post as well, but no luck. As per this post, we need to update the daemon.json file present in the docker config folder with the primary and secondary DNS addresses of our system.
In Linux systems, this daemon.json file is present at /etc/docker/config/
path and in windows, it is present at %programdata%/docker/config/
location. Since I am using windows, I used the later location file to update this info and then restarted my docker and repeated the steps by creating the new image. But no luck at all.
Note: IP addresses have been changed just for posting here. I also tried the same steps for an image for Ubuntu 16.04 but still same issue is coming.