6 solutions for network failure in Docker container Note: The following method is a solution that allows you to ping the public IP in the container. If you cannot ping the public IP, the host may not be able to access the Internet (try ping 8.8.8.8) 1. Use the –net:host option sudo docker run --net:host --name ubuntu_bash -i -t ubuntu:latest /bin/bash 2. Use –dns option sudo docker run --dns 8.8.8.8 --dns 8.8.4.4 --name ubuntu_bash -i -t ubuntu:latest /bin/bash 3. Change DNS server vi /etc/default/docker 4. No need for dnsmasq vi /etc/NetworkManager/NetworkManager.conf sudo restart network-manager sudo restart docker 5. Rebuild the docker0 network pkill docker #Terminate the process iptables -t nat -F #Clear all chains in the nat table ifconfig docker0 down #Stop the docker default bridge brctl delbr docker0 #Delete the bridge docker -d 6. Modify /etc/hosts directly in docker Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: JavaScript gets the scroll bar position and slides the page to the anchor point
>>: Vue+Bootstrap realizes a simple student management system
Table of contents Unary Operators Boolean Operato...
This article introduces the sample code for imple...
This article mainly introduces why v-if and v-for...
This article shares with you the installation and...
Everyone knows that images on web pages are genera...
This article records the detailed installation tu...
This article shares the MySQL free installation c...
It is very simple to build a go environment under...
Recently, when I installed MySQL in Docker, I fou...
I recently upgraded a test server operating syste...
All-round system monitoring tool dstat dstat is a...
routing vue-router4 keeps most of the API unchang...
This article shares the specific code of how to d...
This article example shares the specific code of ...
Table of contents Preface Related Materials Vue p...