在Docker构建期间设置DNS选项 [英] Set DNS options during docker build

查看:248
本文介绍了在Docker构建期间设置DNS选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于本地网络配置,我必须在docker运行命令中添加--dns和--dns-search选项,例如:

Due to local network configuration I have to add --dns and --dns-search options to my docker run commands like so:

docker run --dns XX.XX.1.1 --dns-search companydomain -t mycontainer

但是docker build没有相同的选项。

However docker build doesn't have the same options. Is there a way to specify these options during build?

推荐答案

Docker构建使用在运行时运行的docker引擎的DNS设置。主办。请参阅在此处我的答案以获取更新引擎上DNS设置的步骤。

The docker build uses the DNS settings of the docker engine running on the host. See my answer here for steps to update the DNS settings on the engine.

这篇关于在Docker构建期间设置DNS选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆