How to change “default” docker-machine's dns settings

前端 未结 2 648
时光说笑
时光说笑 2020-12-25 11:38

I know how to create a new docker-machine with dns settings

docker-machine create -d virtualbox --engine-opt dns=8.8.8.8 my_machine

But the

2条回答
  •  自闭症患者
    2020-12-25 12:09

    Go to ~/.docker/machine/machines/default/config.json and add your own DNS server into HostOptions/EngineOptions/Dns and restart docker machine.

    {  
       "HostOptions": {
            "Driver": "",
            "Memory": 0,
            "Disk": 0,
            "EngineOptions": {
                "ArbitraryFlags": [],
                "Dns": ["192.168.99.1","8.8.8.8","8.8.4.4"], <-- set it here
                "GraphDir": ""
            }
    }

提交回复
热议问题