欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

启动docker警告 WARNING: IPv4 forwarding is disabled. Networking will not work

程序员文章站 2024-02-03 20:28:04
...

在启动docker的时候提示警告 WARNING: IPv4 forwarding is disabled. Networking will not work.

[aaa@qq.com ~]# docker run -it --name docano -p 8000:8000 doccano/doccano:latest
WARNING: IPv4 forwarding is disabled. Networking will not work

启动docker警告 WARNING: IPv4 forwarding is disabled. Networking will not work

解决方案如下:

修改配置文件:

vim /usr/lib/sysctl.d/00-system.conf

追加保存并退出

 net.ipv4.ip_forward=1

接着重启网络

[aaa@qq.com ~]# systemctl restart network

然后将之前错误的docker删掉,重新创建启动即可

[aaa@qq.com ~]# docker run -it --name docano -p 8000:8000 doccano/doccano:latest
docker: Error response from daemon: Conflict. The container name "/docano" is already in use by container "34fce6bd5ac6dc38763c99a5e401c0732b48ee9a6c9b61c7226cda5c1d7600f7". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
[aaa@qq.com ~]# docker rm 34fce6bd5ac6dc38763c99a5e401c0732b48ee9a6c9b61c7226cda5c1d7600f7
[aaa@qq.com ~]# docker run -it --name docano -p 8000:8000 doccano/doccano:latest