cannot mount volume over existing file, file exists /var/lib/docker/overlay2/.../merged/usr/share/zoneinfo/UTC 解决

问题产生原因:

linux系统docker-compose.yml文件

cannot mount volume over existing file, file exists /var/lib/docker/overlay2/.../merged/usr/share/zoneinfo/UTC  解决

放到 mac本启动发现启动报错

cannot mount volume over existing file, file exists /var/lib/docker/overlay2/ad14b2c8b4537f394ae710cff4836e85be8d096cdb46e0a8a0c79100be90046d/merged/usr/share/zoneinfo/UTC

初步排查:

mac本上docker 没有/etc 目录权限

cannot mount volume over existing file, file exists /var/lib/docker/overlay2/.../merged/usr/share/zoneinfo/UTC  解决

这里不能也添加

cannot mount volume over existing file, file exists /var/lib/docker/overlay2/.../merged/usr/share/zoneinfo/UTC  解决

解决:

只好复制文件mac本上的/etc/localtime文件 到/Users/feiwang/etc/localtimex

修改docker-compose.yml文件volumns

cannot mount volume over existing file, file exists /var/lib/docker/overlay2/.../merged/usr/share/zoneinfo/UTC  解决

再次启动成功:

cannot mount volume over existing file, file exists /var/lib/docker/overlay2/.../merged/usr/share/zoneinfo/UTC  解决

分析:

根本原因是制作镜像时是在镜像内操作后 直接commit 生成的镜像 类似的cannot mount volume over existing file, file exists 错误 都可以到目录映射上查找原因

上一篇:将/home空间从新挂载到/var/lib/docker


下一篇:docker的/var/lib/docker/overlay文件夹突然占满了硬盘