March 2017
Intermediate to advanced
290 pages
5h 35m
English
Docker provides hostname and DNS configuration for each container without building a custom image. It overlays the /etc files inside the container with virtual files where it can write new information.
This can be seen by running the mount command inside the container. Containers receive the same /resolv.conf as of the host machine when they are created initially. If a host's /resolv.conf file is modified, it will be reflected in the container's /resolv.conf file only when the container is restarted.
In Docker, you can set the dns options in two ways:
docker run --dns=<ip-address>DOCKER_OPTS="--dns ip-address"You can also specify the search domain using --dns-search=<DOMAIN>.
The following diagram shows ...
Read now
Unlock full access