码迷,mamicode.com
首页 > Web开发 > 详细

docker : 报错 WARNING: IPv4 forwarding is disabled. Networking will not work.

时间:2017-11-10 11:45:19      阅读:172      评论:0      收藏:0      [点我收藏+]

标签: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


本文出自 “爱生活的小白” 博客,请务必保留此出处http://sf1314.blog.51cto.com/13295031/1980558

docker : 报错 WARNING: IPv4 forwarding is disabled. Networking will not work.

标签:docker : 报错 warning: ipv4 forwarding is disabled. networking will not work.

原文地址:http://sf1314.blog.51cto.com/13295031/1980558

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!