Docker containers continue to lose internet

I configured to use dockers on Centos 6.5. Quite often, containers continue to lose Internet. In such cases, I need to restart Docker on the host. I recently tried to start yum update from a container that failed. The following is the log from / var / log / docker

2014/07/15 10:33:36 GET /v1.12/containers/update_test/json [b601ba8c] +job container_inspect(update_test) [b601ba8c] -job container_inspect(update_test) = OK (0) 2014/07/15 10:33:36 POST /v1.12/containers/update_test/attach?stderr=1&stdin=1&stdout=1&stream=1 [b601ba8c] +job container_inspect(update_test) 2014/07/15 10:33:36 POST /v1.12/containers/update_test/start [b601ba8c] +job start(update_test) [b601ba8c] -job container_inspect(update_test) = OK (0) [b601ba8c] +job attach(update_test) [b601ba8c] +job allocate_interface(5a5c0247441ef5872b531ba720ba1f7d8af2df1cbd47b4a98b84a7b995384d8b) [b601ba8c] -job allocate_interface(5a5c0247441ef5872b531ba720ba1f7d8af2df1cbd47b4a98b84a7b995384d8b) = OK (0) [b601ba8c] -job start(update_test) = OK (0) 2014/07/15 10:33:36 POST /v1.12/containers/update_test/resize?h=37&w=165 [b601ba8c] +job resize(update_test, 37, 165) [b601ba8c] -job resize(update_test, 37, 165) = OK (0) [b601ba8c] +job release_interface(5a5c0247441ef5872b531ba720ba1f7d8af2df1cbd47b4a98b84a7b995384d8b) [b601ba8c] -job release_interface(5a5c0247441ef5872b531ba720ba1f7d8af2df1cbd47b4a98b84a7b995384d8b) = OK (0) [error] container.go:492 5a5c0247441ef5872b531ba720ba1f7d8af2df1cbd47b4a98b84a7b995384d8b: Error closing terminal: invalid argument [b601ba8c] -job attach(update_test) = OK (0) 

As mentioned above, restarting Docker on the host solves the problem. I do not want to restart the docker, as I plan to launch the production application through the docker. Does anyone have an idea in this regard?

Please let me know if you need more information in this regard.

+6
source share
2 answers

I feel bad that I did not mention that the host was hosted in Rackspace. I apologize for not clarifying that (at that time I thought it didn’t matter). It was an automatic Rackspace procedure that continued to corrupt iptables, which clearly affected docker routing. Rackspace suggested creating a lock file somewhere in the / etc file to prevent an automatic routine regarding iptables that I forgot now; It should not be difficult for anyone to get it from them if they are having a problem.

0
source

If you do not install DNS on the host /etc/resolv.conf , you may encounter some problems on the Internet; If you still have this problem, consider using --dns 209.244.0.3 in docker run settings; The solution might look like this:

docker run -d --dns 209.244.0.3 centos webapp.sh

Another useful option that you may need at some point in this question is --add-host , which adds the host to the /etc/hosts container /etc/hosts

0
source

Source: https://habr.com/ru/post/972239/


All Articles