Docker

学习笔记:Docker单独配置DNS

1\. 配置文件: 2\. 格式:json 一般来说,新装的docker没有该文件,vi或者其它编辑器直接添加以下内容: { "dns": \["223.5.5.5", "223.6.6.6"\] } 3\. 验证 docker run --rm -it alpine nslookup baidu.com 在输出中Se

1. 配置文件: /etc/docker/daemon.json

2. 格式:json

一般来说,新装的docker没有该文件,vi或者其它编辑器直接添加以下内容:

{

"dns": ["223.5.5.5", "223.6.6.6"]

}

3. 验证

docker run --rm -it alpine nslookup baidu.com

在输出中Server行出现刚刚配置的DNS,表示配置成功。

N
norvyn

独立 iOS 开发者,写字的人。在一座有海的城市,慢慢地做一些小而确定的东西。An independent iOS developer and writer — slowly making small, certain things in a city by the sea.

评论Comments

加载中…Loading…

留下评论Leave a comment