docker run --dns 8.8.8.8 myimage

Category: Docker

docker run --dns 8.8.8.8 myimage

Set a custom DNS server for the container

Sets the DNS server the container uses for name resolution, instead of inheriting from the host.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.