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
Result: Implementation Code html <div id="...
I have roughly listed some values to stimulate ...
About Docker Swarm Docker Swarm consists of two p...
Connection query: It is the result of connecting ...
This article example shares the specific code for...
1. Introduction to gitlab Gitlab official address...
This article shares the specific code of jQuery t...
How to solve the Mysql transaction operation fail...
Table of contents background LIMIT Optimization O...
environment Centos 6.6 MySQL 5.7 Install If the s...
Referring to the online information, I used cmake...
First, pull the image (or just create a container...
I am very happy to attend this episode of potato ...
Software and hardware environment centos7.6.1810 ...
This article shares with you the solution to the ...