DockerCE之执行docker info出现两条警告信息及解决方案

 更新时间:2024年02月04日 17:02:21   作者:cnskylee  
这篇文章主要介绍了DockerCE之执行docker info出现两条警告信息及解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教

DockerCE之执行docker info出现两条警告信息

安装完docker-ce 20.10.12版本后,执行docker info的时候出现下面的警告信息。

WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

[root@node-1 docker-ce]# systemctl start docker.service
[root@node-1 docker-ce]# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since 四 2021-12-16 07:13:27 CST; 1s ago
     Docs: https://docs.docker.com
 Main PID: 96606 (dockerd)
    Tasks: 8
   Memory: 27.5M
   CGroup: /system.slice/docker.service
           └─96606 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
 
12月 16 07:13:27 node-1 dockerd[96606]: time="2021-12-16T07:13:27.284939882+08:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
12月 16 07:13:27 node-1 dockerd[96606]: time="2021-12-16T07:13:27.284958321+08:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}" module=grpc
12月 16 07:13:27 node-1 dockerd[96606]: time="2021-12-16T07:13:27.284970554+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
12月 16 07:13:27 node-1 dockerd[96606]: time="2021-12-16T07:13:27.347482341+08:00" level=info msg="Loading containers: start."
12月 16 07:13:27 node-1 dockerd[96606]: time="2021-12-16T07:13:27.733612330+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
12月 16 07:13:27 node-1 dockerd[96606]: time="2021-12-16T07:13:27.820102802+08:00" level=info msg="Loading containers: done."
12月 16 07:13:27 node-1 dockerd[96606]: time="2021-12-16T07:13:27.867156288+08:00" level=info msg="Docker daemon" commit=459d0df graphdriver(s)=overlay2 version=20.10.12
12月 16 07:13:27 node-1 dockerd[96606]: time="2021-12-16T07:13:27.867280919+08:00" level=info msg="Daemon has completed initialization"
12月 16 07:13:27 node-1 systemd[1]: Started Docker Application Container Engine.
12月 16 07:13:27 node-1 dockerd[96606]: time="2021-12-16T07:13:27.928730639+08:00" level=info msg="API listen on /var/run/docker.sock"
[root@node-1 docker-ce]# docker info
Client:
 Debug Mode: false
 Plugins:
  scan: Docker Scan (Docker Inc., v0.9.0)
 
Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc version: v1.0.2-0-g52b36a2
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-1160.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 7.777GiB
 Name: node-1
 ID: D4T7:EWDQ:JKDN:REHH:ODYZ:LPEV:YQU4:FWAE:FSKF:ATUQ:5IV6:GAFL
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

解决

在/etc/sysctl.info文件中增加下面两行配置,保存后执行sysctl -p即可。

net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1

[root@node-1 docker-ce]# vi /etc/sysctl.conf 
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
 
vm.max_map_count=262145
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
 
[root@node-1 docker-ce]# sysctl -p
vm.max_map_count = 262145
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
 
[root@node-1 docker-ce]# docker info
Client:
 Debug Mode: false
 Plugins:
  scan: Docker Scan (Docker Inc., v0.9.0)
 
Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc version: v1.0.2-0-g52b36a2
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-1160.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 7.777GiB
 Name: node-1
 ID: D4T7:EWDQ:JKDN:REHH:ODYZ:LPEV:YQU4:FWAE:FSKF:ATUQ:5IV6:GAFL
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 
[root@node-1 docker-ce]# 

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

相关文章

  • win10+Docker Toolbox+mysql教程

    win10+Docker Toolbox+mysql教程

    这篇文章主要介绍了win10+Docker Toolbox+mysql教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教
    2023-11-11
  • docker-compose安装db2数据库操作

    docker-compose安装db2数据库操作

    这篇文章主要介绍了docker-compose安装db2数据库操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2020-12-12
  • Docker容器运行ASP.NET Core的实现步骤

    Docker容器运行ASP.NET Core的实现步骤

    这篇文章主要介绍了Docker容器运行ASP.NET Core的实现步骤,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2019-04-04
  • 基于docker搭建selenium分布式环境

    基于docker搭建selenium分布式环境

    这篇文章主要介绍了基于docker搭建selenium分布式环境,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
    2020-11-11
  • 详解Docker commit的使用

    详解Docker commit的使用

    这篇文章主要介绍了Docker commit使用的相关资料,帮助大家更好的理解和使用docker容器,感兴趣的朋友可以了解下
    2020-09-09
  • linux环境部署及docker安装redis的方法

    linux环境部署及docker安装redis的方法

    这篇文章主要介绍了linux环境部署及docker安装redis的方法,本文给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
    2019-08-08
  • docker容器/etc/hosts文件修改方法

    docker容器/etc/hosts文件修改方法

    在容器内部,当需要访问其他容器或主机时,可以通过/etc/hosts文件来解析主机名,从而实现网络通信,这篇文章主要介绍了docker容器/etc/hosts文件,需要的朋友可以参考下
    2023-06-06
  • 深入理解docker镜像的分层(小白必看)

    深入理解docker镜像的分层(小白必看)

    本文关键详细介绍了Docker镜像层次的基本原理详细说明,原文中根据实例编码详细介绍的十分详尽,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2022-03-03
  • 利用docker搭建php7和nginx运行环境全过程(官方镜像)

    利用docker搭建php7和nginx运行环境全过程(官方镜像)

    docker提供了在服务端分布式的部署应用,这样的好处是方便维护和升级。下面这篇文章主要给大家介绍了利用docker搭建php7和nginx运行环境的相关资料,搭建过程中运用的是官方镜像,需要的朋友可以参考借鉴,下面来一起看看吧。
    2017-05-05
  • Docker Hub运行原理及实现过程解析

    Docker Hub运行原理及实现过程解析

    这篇文章主要介绍了Docker Hub运行原理及实现过程解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
    2020-10-10

最新评论