Greetings ladies and gentlemen,
If you found this article, you most likely came across this nasty error:
Step 3/8 : RUN apt-get update && apt-get install gcc python3-dev mariadb-client mariadb-server -y ---> Running in 7adba5657671 Err:1 http://deb.debian.org/debian buster InRelease Temporary failure resolving 'deb.debian.org' Err:2 http://security.debian.org/debian-security buster/updates InRelease Temporary failure resolving 'security.debian.org' Err:3 http://deb.debian.org/debian buster-updates InRelease Temporary failure resolving 'deb.debian.org' Reading package lists... 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. Reading package lists... Building dependency tree... Reading state information... Package python3-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python3-dev' has no installation candidate E: Unable to locate package mariadb-client E: Unable to locate package mariadb-server ERROR: Service 'process-test-results' failed to build : The command '/bin/sh -c apt-get update && apt-get install gcc python3-dev mariadb-client mariadb-server -y' returned a non-zero code: 100
It most likely popped up during a docker build or docker-compose build.
You've tried to figure it out but Google and StackOverFlow didn't give you much to work with. I know, I've been there.
Let's run the following command:
If that's what you've got:
# Please ignore all the lines that start with a hash symbol nameserver 127.0.0.53
You came to the right place. Apparently, there's an open bug related to Docker and DNS 18.104.22.168 here.
You most likely using Ubuntu 18.04 / 20.04 which comes pre installed with systemd, which.. also contain systemd-resolved and that's why it set to nameserver 127.0.0.53.
Basically, during a build, a docker container is taking that DNS and trying to use it inside a container. But it can't.
Well, now when we sort of knows what's the issue, we can finally solve it.
Before you start, make sure you know what you're doing. messing up with your DNS can leave your host without internet access which can be really inconvenient.
In any case, if that happened, you better check /etc/resolv.conf and make sure that it has these lines:
nameserver 22.214.171.124 nameserver 126.96.36.199
- Stop and disable systemd-resolved
sudo systemctl disable systemd-resolved sudo systemctl stop systemd-resolved
- Set Network Manager to recognize systemd-resolved as disabled
vim /etc/NetworkManager/NetworkManager.conf # And then change dns to default. ex: # dns=default
- Remove the old /etc/resolv.conf file
- Restart Network Manager
sudo systemctl restart NetworkManager
- Use dnsmasq to add google's DNS server into /etc/resolv.conf since it can't be modified directly
sudo vim /etc/dnsmasq.conf # Add to the end of the file: server=188.8.131.52 server=184.108.40.206