For system, network and cloud administrators
This can happen after a fresh installation of CentOS. The /etc/resolv.conf is looking for a DNS that it can use but after a fresh installation, it usually comes empty. So, if the file has no DNS to look after, then it can not resolve hostnames. This should tell you that the current machine is using the wrong DNS server.
I came across situations where I needed tot test which Docker image would be most suitable for a particular set of needs and one of those metrics that I used was disk space. I remember the more I used to get started with Docker, the more I was curious to see which Docker images consume more or less resources.
In order to view the IP of a Docker container, you can execute the following command:
docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" container_ID_or_name
But you can also use grep:
docker inspect container_name | grep "IPv4"
In the process of building a Docker image, you might find yourself in the situation where a “none” image is dangling in your Docker registry, as seen below:
In order to remove the “none” Docker images, you can use:
docker rmi -f $(docker images --filter "dangling=true" -q --no-trunc)