I am setting up a new development environment in AWS Workspaces and I noticed that when I go to run docker build
, I get the following errors:
---> Running in d18733d53c16
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Someone over in Reddit mentioned that this is a known issue, but AWS Documentation doesn’t seem to mention this issue and I can’t find much more on this online.
It’s just a standard Docker file that’s been in use for about a year now with no issues. Just seems to be happening in AWS Workspaces for Linux.
2
Answers
I was finally able to get this resolved by adding DNS entries into my
Dockerfile
in the top before doing anything else.For example:
turned into:
and now all is well.
It seems that docker images using the bridged networking cannot access the DNS of the host. I suspect that AWS workspaces DNS are doing some filtering.
Using host networking it works.
If you need to use bridged networking, then I suggest to force docker to use Google’s DNS as a workaround