我的DockerFile包含以下指令:
My DockerFile contains the following instruction:
rm -f plugins.7z此命令在Docker的早期版本中按预期工作,但在1.13版本中失败。我看到错误:
This command worked as expected in earlier versions of docker but fails with version 1.13. I see the error:
cannot access plugins.7z: No such file or directory如果我打开一个带有基本映像的容器并手动执行命令,则会看到相同的错误。
If I bring up a container with the base image and execute the command manually, I see the same error.
试图列出文件夹内容显示:
Trying to list the folder contents displays:
# ls -lrt ls: cannot access plugins.7z: No such file or directory total 12 ??????????? ? ? ? ? ? plugins.7z在 Docker问题。如何进一步调试问题?
This is not listed as a known issue in Docker Issues. How do I debug the issue further?
编辑:
推荐答案
删除目录失败的原因是未使用d_type支持( ftype = 1)格式化支持( xfs )文件系统;您可以在github上找到讨论; github/docker/docker/issues/27358 。
The reason removing directories fails is that the backing (xfs) filesystem was not formatted with d_type support ("ftype=1"); you can find a discussion on github; github/docker/docker/issues/27358.
要验证系统上是否提供 d_type 支持,请检查 docker的输出信息;
To verify if d_type support is available on your system, check the output of docker info;
Server Version: 1.13.1 Storage Driver: overlay Backing Filesystem: xfs Supports d_type: false Logging Driver: json-fileRHEL / CentOS的发行说明
请注意,必须使用 -n ftype = 1 选项已启用,可以用作叠加层。使用rootfs和在系统安装期间创建的任何文件系统,在Anaconda kickstart中设置-mkfsoptions = -n ftype = 1 参数。安装后创建新文件系统时,运行#mkfs -t xfs -n ftype = 1 / PATH / TO / DEVICE 命令。要确定现有文件系统是否适合用作覆盖,请运行#xfs_info / PATH / TO / DEVICE | grep ftype 命令查看是否启用了 ftype = 1 选项。
Note that XFS file systems must be created with the -n ftype=1 option enabled for use as an overlay. With the rootfs and any file systems created during system installation, set the --mkfsoptions=-n ftype=1 parameters in the Anaconda kickstart. When creating a new file system after the installation, run the # mkfs -t xfs -n ftype=1 /PATH/TO/DEVICE command. To determine whether an existing file system is eligible for use as an overlay, run the # xfs_info /PATH/TO/DEVICE | grep ftype command to see if the ftype=1 option is enabled.
也可以解决该问题;
- 使用 ftype = 1
- 使用其他存储驱动程序。请注意,不建议将默认设备映射器配置(使用环回设备)用于生产,因此需要手动配置。
-compatibility(较旧版本的docker允许在没有 d_type 的系统上运行叠加),docker 1.13只会在守护程序日志中记录 warning ( github/docker/docker/pull/27433 ),但不会在以后的版本中不再受支持。
For backward-compatibility (older versions of docker allowed running overlay on systems without d_type), docker 1.13 will only log a warning in the daemon logs (github/docker/docker/pull/27433), but will no longer be supported in a future version.
更多推荐
Docker在构建映像时无法删除文件
发布评论