Docker之常见问题解决

一 swap警告

1.1 警告信息

WARNING: No swap limit support

1.2 解决办法

1.2.1 修改grub文件

root@ubuntu:~# cat /etc/default/grub

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=Ubuntu
GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0"
GRUB_CMDLINE_LINUX="video=800x600 cgroup_enable=memory swapaccount=1"

修改 GRUB_CMDLINE_LINUX="video=800x600 cgroup_enable=memory swapaccount=1"

1.2.2 更新grub

点击查看代码
root@ubuntu:~# update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-161-generic
Found initrd image: /boot/initrd.img-4.15.0-161-generic
Found linux image: /boot/vmlinuz-4.15.0-159-generic
Found initrd image: /boot/initrd.img-4.15.0-159-generic
Found linux image: /boot/vmlinuz-4.15.0-156-generic
Found initrd image: /boot/initrd.img-4.15.0-156-generic
done

1.2.3 重启服务器

root@ubuntu:~# reboot

1.3 验证结果

点击查看代码
root@ubuntu:~# docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.6.3-docker)
  scan: Docker Scan (Docker Inc., v0.9.0)

Server:
Containers: 5
Running: 0
Paused: 0
Stopped: 5
Images: 2
Server Version: 19.03.15
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
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: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc version: v1.0.2-0-g52b36a2
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-161-generic
Operating System: Ubuntu 18.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 920.6MiB
Name: ubuntu
ID: C7OW:36ZY:23TD:WZPR:ILLI:MFXS:I3WJ:6I7Q:U7DX:OMOC:ITUR:XSG4
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
Registry Mirrors:
https://fv50tv30.mirror.aliyuncs.com/
https://reg-mirror.qiniu.com/
Live Restore Enabled: false

posted @ 2021-11-05 13:21  小吉猫  阅读(145)  评论(0编辑  收藏  举报