How to specify docker image's DNS?

Now I have a lot of docker containers running on my host machine, and inside the containers, dns-look-up is very slow. So I want to change the containers’ DNS.

I’ve known two possible ways:

  • Persist users across containers
  • Add Logtrail plugin to kibana to see the logs in kibana ui - openshift/origin-aggregated-logging
  • Running Bottle (back end) + Nodejs (front end) on Google App Engine
  • autoconf configure warning: /usr/bin/file: No such file or directory
  • Connecting postgres from typeorm docker container
  • Secure Admin must be enabled to access the DAS remotely - Acess Glassfish Admin Console with Docker
  • 1) use command-line argument ‘-dns’
    2) modify /etc/default/docker -> DOCKER_OPTS and restart docker daemon

    The above two ways force me to either change my docker run command, or restart daemon which will stop all currently running containers. I cannot accept these.

    So, is there any way else to change a docker image’s DNS? (re-run an image is acceptable)

  • Domain resolves on host machine but not inside docker container
  • Edit default .htaccess in wordpress docker
  • Docker-compose Predis not connection via PHP
  • Vaultier is unusable for docker/ubuntu/debian (Python)
  • Fixing Permissions on Docker
  • How to backup/restore docker image for deployment?
  • One Solution collect form web for “How to specify docker image's DNS?”

    You can write to /etc/resolv.conf inside a container. Perhaps EXEC a script that does that and then runs the real program.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.