[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
 
-----------------------------------------------------------------------------------

相关文章:

  • 2022-02-19
  • 2022-03-05
  • 2022-12-23
  • 2021-10-30
  • 2021-12-23
  • 2022-01-20
  • 2022-12-23
  • 2021-07-20
猜你喜欢
  • 2021-07-23
  • 2021-10-28
  • 2021-11-24
相关资源
相似解决方案