简体   繁体   English

无根 docker 无法访问主机详细信息

[英]rootless docker not able to access host details

Below is the comparision-下面是对比——

docker-ce 20.10.12 is installed on root user and we have "alias" called "acme" , start the container , from the container , we run "nslookup acme", it gives the result especially an ip. docker-ce 20.10.12 安装在 root 用户上,我们有一个名为“acme”的“别名”,启动容器,从容器中运行“nslookup acme”,它给出的结果尤其是一个 ip。 For example, it would print "acme.example.com" with an IP.例如,它将打印带有 IP 的“acme.example.com”。

but when compared to docker-ce 20.10.12 installed as "rootless" (not on root user), start the container, from the container, if we run "nslookup acme", it doesnt return IP, mentions 'server cant find...'.但是与安装为“rootless”(不是 root 用户)的 docker-ce 20.10.12 相比,从容器启动容器,如果我们运行“nslookup acme”,它不会返回 IP,提到“服务器找不到.. .'.

So how do we fix this on rootless docker daemon ?那么我们如何在无根 docker daemon 上解决这个问题呢?

Never mind - explored and researched a lot, below link helps (--add-host)没关系 - 探索和研究了很多,下面的链接有帮助(--add-host)

https://www.thegeekdiary.com/how-to-add-new-host-entry-in-etc-hosts-when-a-docker-container-is-run/ https://www.thegeekdiary.com/how-to-add-new-host-entry-in-etc-hosts-when-a-docker-container-is-run/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM