Skip to content

Instantly share code, notes, and snippets.

@guma44
Last active October 25, 2017 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guma44/77f8a23d662289b36cd66608fc2d4ab1 to your computer and use it in GitHub Desktop.
Save guma44/77f8a23d662289b36cd66608fc2d4ab1 to your computer and use it in GitHub Desktop.
Docker network setup in a company machine

SO

On the host, find out the primary and secondary DNS server addresses:

$ nmcli dev show | grep 'IP4.DNS'
IP4.DNS[1]:              10.0.0.2
IP4.DNS[2]:              10.0.0.3

Using these addresses, create a file /etc/docker/daemon.json:

$ sudo su root
# cd /etc/docker
# touch daemon.json

Put this in /etc/docker/daemon.json:

{                                                                          
    "dns": ["10.0.0.2", "10.0.0.3"]                                                                           
}

Exit from root.

Now restart docker:

$ sudo service docker restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment