docker container with empty /etc/resolv.conf file

asked 2016-06-03 00:49:40 -0500

ykuo gravatar image

When running docker container directly (not from openstack), it would bind mount the host machine's /etc/resolv.conf file (in the absence of the --dns=IP_ADDRESS..., --dns-search=DOMAIN..., or --dns-opt=OPTION... options)

But running docker container with openstack using nova-docker, the /etc/resolv.conf file is always empty. Running mount command from the container shows the /etc/resolv.conf file is not bind mounted.

Is there a way for it to get the settings from host machine's /etc/resolv.conf file?

edit retag flag offensive close merge delete


Probably that info is at the dhcp namespace folder:


There are the hosts files and everything related with namespaces.

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2016-06-03 01:37:51 -0500 )edit

I can see that in opts file there is a setting for dns-server set properly. but still the booted docker containers have empty /etc/resolv.conf file. I am running compute host on centos 7 distro.

ykuo gravatar imageykuo ( 2016-06-03 12:00:36 -0500 )edit