当我查看docker详细信息时会看到如下警告:

WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.

问题原因:

centos系统docker默认使用存储驱动是devicemapper,而这种存储驱动有两种模式loop-lvm和direct-lvm,不巧默认又使用了比较低效的loop-lvm

解决方案一

使用direct-lvm,配置方式网上很多

解决方案二:

使用overlay文件系统

因为这个方案比较简单,配置步骤如下:
1.加载overlay模块

echo "overlay" > /etc/modules-load.d/overlay.conf
modprobe overlay
lsmod | grep over
reboot

2.删除docker配置信息

rm -rf /var/lib/docker

3.修改docker启动参数

vim /usr/lib/systemd/system/docker.service
#ExecStart=/usr/bin/dockerd
ExecStart=/usr/bin/dockerd --storage-driver=overlay2 -g /opt/docker

4.重启docker

systemctl daemon-reload
systemctl restart docker

5.检测

#docker info
Containers:
Running:
Paused:
Stopped:
Images:
Server Version: 18.06.-ce
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.-862.14..el7.x86_64
Operating System: CentOS Linux (Core)
OSType: linux
Architecture: x86_64
CPUs:
Total Memory: .7GiB
Name: centos7-hk122
ID: 3AG5:7RUW:OZZF:ZW7Q:FRMQ:AB3M:AQWX:YIJR:H63R:JI5R:DKGS:HDUM
Docker Root Dir: /opt/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/
Live Restore Enabled: false

不再弹出警告信息

最新文章

  1. LeetCode Smallest Rectangle Enclosing Black Pixels
  2. [Python]处理windows下多级目录文件,上传到Linux服务器
  3. JNI日志调试LOG和中文乱码
  4. [OpenJudge 3061]Flip The Card
  5. 针对安卓java入门:条件语句和循环语句
  6. thinkphp 3+ 观后详解 (5)
  7. 从零开始学ios开发(八):Autorotation and Autosizing
  8. 【机房系统知识小结】微软自带RDLC报表,数据汇总设计
  9. 【转】UILabel、UITextView自适应得到高度
  10. React Native 之 数据持久化
  11. OpenCV学习2-----使用inpaint函数进行图像修复
  12. vs运行单个cpp文件
  13. [2]十道算法题【Java实现】
  14. 个人Source Insight使用设置笔记
  15. echart 标题配置
  16. 一脸懵逼学习HBase的搭建(注意HBase的版本)
  17. Navicat连接Oracle的几个问题及解决方案
  18. linux命令: chown命令
  19. iBatis resultMap报错 nullValue完美解决
  20. gitlab提交内容关联到slack通知

热门文章

  1. Flask上下文源码分析(一)
  2. 常见的可以写入VIM配置文件中的设置参数
  3. MySQL数据库可以用任意ip连接访问的方法
  4. Mat转CImage
  5. SQL-W3School-函数:SQL HAVING 子句
  6. Canvas恢复布局
  7. ISO/IEC 9899:2011 条款6.4.8——预处理数字
  8. jsp中用java代码拼接下拉选备选项及默认值【我】
  9. CNCF基金会的Certified Kubernetes Administrator认证考试计划
  10. 关于做移动端ui自动化测试使用PC代理网络会出现的问题