gpt4 book ai didi

文件系统为 xfs 且存储驱动程序覆盖时 Docker 卷映射文件损坏

转载 作者:行者123 更新时间:2023-12-02 21:24:01 26 4
gpt4 key购买 nike

当我在 Docker 1.13.0 中进行卷映射时,某些文件已损坏。

在 docker 容器中,当“ls -l”文件夹时,它显示如下:

“???????????? ? ? ? ? ? file_corrpted_and_cant_access.conf”

并且不能编辑或删除它。
它只是显示“没有这样的文件或目录”。
我认为它无法链接文件 inode 和路径。

如何解决?

附加信息

卷映射后,我在 docker 容器内软链接(soft link)卷映射文件夹。
docker run --privileged -d -v /opt/volume_mapping_folder/:/inside_container/inside_folder --restart=always testcontainer
和 insde docker 容器 I 软链接(soft link)文件夹
docker -it testcontainer /bin/bashln -s /inside_container/inside_folder /opt/appFoldertouch /opt/appFolder/file_corrpted_and_cant_access.conf
docker info 的输出:

Server Version: 1.13.0
Storage Driver: overlay
Backing Filesystem: xfs
Supports d_type: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e
runc version: 2f7393a47307a16f8cee44a37b262e8b81021e3e
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-514.6.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 5.671 GiB
ID: 2D2E:73MA:BJQ3:WQAJ:BR3W:TYF5:F3MQ:E7S3:KZGV:A64K:ASZK:UEXE
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

最佳答案

这是与覆盖模式相关的 xfs 文件系统。

https://github.com/docker/docker/issues/27358

解决方案就是其中之一。

  • xfs 分区需要格式化,ftype 设置为 1
  • 使用 ext4 文件系统而不是 xfs
  • 将 docker 存储驱动程序设置为 'devicemapper'
  • 关于文件系统为 xfs 且存储驱动程序覆盖时 Docker 卷映射文件损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41867734/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com