zoukankan      html  css  js  c++  java
  • 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
     
    -----------------------------------------------------------------------------------
  • 相关阅读:
    Redis 是单进程单线程的?
    LeetCode-114. Flatten Binary Tree to Linked List
    Java HashMap源码分析
    转:zookeeper中Watcher和Notifications
    分布式服务框架
    LeetCode-330.Patching Array
    转:String StringBuffer StringBuilder区别
    最小堆代码实现
    数组的各类排序
    两步建立 ssh 反向隧道
  • 原文地址:https://www.cnblogs.com/daxiansmd/p/6413063.html
Copyright © 2011-2022 走看看