使用docker容器时遇到的2个问题
2024-09-05 17:55:30
最近项目在centOS7服务器上用docker部署了几个服务,在运行的时候发现,总是过一段时间,容器内的根目录就变为只读而无法写入了。
经过调查都是因为docker/devicemapper/devicemapper/data文件写满无法再写入而造成的。
具体分析可参见博文https://segmentfault.com/a/1190000004302467
现将在centOS7使用docker需要注意的两点罗列如下:
1.保存docker/devicemapper/devicemapper/data文件的分区要足够大
可以在/etc/sysconfig/docker中更改默认的存储路径
# /etc/sysconfig/docker # Modify these options if you want to change the way the docker daemon runs
OPTIONS='--graph="/data0/docker" --selinux-enabled' DOCKER_CERT_PATH=/etc/docker
2.docker/devicemapper/devicemapper/data文件的默认大小为107.4GB, 如果可以的话在启动docker之前把这个值设的尽量大一些
如想设置文件大小为1.6T,可执行下面命令
dd if=/dev/zero of=/data0/docker/devicemapper/devicemapper/data bs=1G count=0 seek=1600
最新文章
- 【javascript激增的思考04】MVC与Backbone.js(beta)
- linux shell脚本通过参数名传递参数值
- Gradle build设置自动log开关
- leap motion
- wikioi 1688 求逆序对
- 对Slony-I中wait on的理解
- 面向XX编程
- JSLink to render the list to show people detail info with picture
- unity 编辑器和插件生产(四.2)
- 利用ATiny85制作BadUSB
- vertx的Future设计
- vue2.0 微信分享
- 调试dump文件
- PHP之常用设计模式
- python的time模块总结
- python-思路整理-虚拟环境
- merge_节点
- 【慕课网实战】Spark Streaming实时流处理项目实战笔记三之铭文升级版
- [CentOS7] [VMWARE] 增加磁盘空间后扩大逻辑分区
- 操作iframe 的方法与兼容性
热门文章
- 利用 Hexo + Github 搭建自己的博客
- PP: GRU-ODE-Bayes: Continuous modeling of sporadically-observed time series
- dataTables插件的使用
- 认识Flow(一)
- python3练习100题——032
- matplotlib 的一些知识
- 判断IE版本的HTML语句[if lte IE 9]……[endif]
- ASP.NET Process Model之二:ASP.NET Http Runtime Pipeline - Part II
- Python入门9 —— 循环
- 记录 shell学习过程(5)continue break