docker info提示WARNING: No swap limit support

Posted x-knight

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker info提示WARNING: No swap limit support相关的知识,希望对你有一定的参考价值。

问题描述:

  装完docker后,用docker info ,显示:WARNING: No swap limit support,这句话有什么特别的意思吗?如果是我的虚拟机配置问题,那又需要作哪些改动呢。

[email protected]:~$ sudo docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 17.05.0-ce
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 0
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.13.0-43-generic
Operating System: Ubuntu 16.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.57GiB
Name: xknight-optiplex-7040
ID: AWE3:LSXJ:PENS:3QSC:D2BB:5UOL:E4NN:GEUQ:PWJQ:HG5P:25XN:WZAL
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

 问题解决:

  根据错误提示,只是cgroups中的swap account没有开启。这个功能应该是用在 `docker run -m=1524288 -it ubuntu /bin/bash` 类似的命令,用来限制一个docker容器的内存使用上限,所以这里只是WARNING,不影响使用。

  这个默认官方给予解决方法了,地址是https://docs.docker.com/installation/ubuntulinux/

 1 When users run Docker, they may see these messages when working with an image:
 2 WARNING: Your kernel does not support cgroup swap limit. WARNING: Your
 3 kernel does not support swap limit capabilities. Limitation discarded.
 4 To prevent these messages, enable memory and swap accounting on your system. To enable these on system using GNU GRUB (GNU GRand Unified Bootloader), do the following.
 5 Log into Ubuntu as a user with sudo privileges.
 6 Edit the /etc/default/grub file.
 7 Set the GRUB_CMDLINE_LINUX value as follows:
 8 GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
 9 Save and close the file.
10 Update GRUB.
11 $ sudo update-grub
12 Reboot your system.

 

以上是关于docker info提示WARNING: No swap limit support的主要内容,如果未能解决你的问题,请参考以下文章

Mac iTerm2登陆CentOS提示warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or dire

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

搭建docker-python环境时提示WARNING: pip is configured with locations that require TLS/SSL, however the ssl

搭建docker-python环境时提示WARNING: pip is configured with locations that require TLS/SSL, however the ssl(

php 编译安装插件提示PHP Warning: PHP Startup: Unable to load dynamic library 报错

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed;