简体   繁体   中英

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. For example, it would print "acme.example.com" with an IP.

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...'.

So how do we fix this on rootless docker daemon ?

Never mind - explored and researched a lot, below link helps (--add-host)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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