docker : 報錯 WARNING: IPv4 forwarding is disabled. Networking will not work.


[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl start docker
[root@localhost ~]# docker images
REPOSITORY                     TAG                 IMAGE ID            CREATED             SIZE
hub.c.163.com/library/nginx    latest              db079554b4d2        10 hours ago        181.8 MB
hub.c.163.com/library/tomcat   latest              c822d296d232        3 weeks ago         355.2 MB

 

注意:創建容器的時候報這個錯

[root@localhost ~]# docker run -ti -p 80:80 hub.c.163.com/library/nginx  /bin/bash
WARNING: IPv4 forwarding is disabled. Networking will not work.  

 

解決辦法:

[root@localhost ~]# vi /usr/lib/sysctl.d/00-system.conf

添加如下代碼:
    net.ipv4.ip_forward=1

重啟network服務
# systemctl restart network
 
-------------------------------------
 
解決完成以后 刪除掉 做錯的 容器,再次創建  就可以了 :
docker rm -f ea73dcb26ff5
 
-----------------------------------------------------------------------------------


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM