赞
踩
使用nerdctl套件构建镜像,遇见了报错:
- [root@docker <localhost> /image_root ]#nerdctl build -f Dockerfile .
- [+] Building 3.3s (6/6) FINISHED
- => [internal] load build definition from Dockerfile 0.0s
- => => transferring dockerfile: 238B 0.0s
- => [internal] load .dockerignore 0.0s
- => => transferring context: 2B 0.0s
- => [internal] load build context 0.3s
- => => transferring context: 287.88kB 0.3s
- => [1/2] WORKDIR /home/build/image_root/ 0 .0s
- => CACHED [2/2] COPY build_root/ . 0.0s
- => exporting to oci image format 2.8s
- => => exporting layers 0.0s
- => => exporting manifest sha256:3f2ec... 0.0s
- => => exporting config sha256:a4901... 0.0s
- => => sending tarball 2.7s
- unpacking overlayfs@sha256:3f2ec... (sha256:3f2ec...)...FATA[0004] failed to stat snapshot sha256:ac2706: snapshotter not loaded: overlayfs: invalid argument
查看containerd组件加载情况,发现overlayfs异常
- [root@docker <localhost> /pkg ]#ctr plugin ls
- TYPE ID PLATFORMS STATUS
- io.containerd.content.v1 content - ok
- io.containerd.snapshotter.v1 aufs linux/amd64 skip
- io.containerd.snapshotter.v1 btrfs linux/amd64 skip
- io.containerd.snapshotter.v1 devmapper linux/amd64 error
- io.containerd.snapshotter.v1 native linux/amd64 ok
- io.containerd.snapshotter.v1 overlayfs linux/amd64 error
- io.containerd.snapshotter.v1 zfs linux/amd64 skip
- io.containerd.metadata.v1 bolt - ok
- io.containerd.differ.v1 walking linux/amd64 ok
在查看containerd运行日志,存在报错:
- ... ...
- WARN[2022-01-18T22:02:44.263567300+08:00] could not use snapshotter overlayfs in metadata plugin error="/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs does not support d_type. If the backing filesystem is xfs, please reformat with ftype=1 to enable d_type support"
-
- ... ...
-
- INFO[2022-01-18T22:02:44.351374971+08:00] Connect containerd service
- WARN[2022-01-18T22:02:44.351487012+08:00] failed to load plugin io.containerd.grpc.v1.cri error="failed to create CRI service: failed to find snapshotter \"overlayfs\""
查看容器内的文件系统,确认为xfs文件系统:
- /dev/vda3 on /etc/resolv.conf type xfs (rw,relatime,attr2,inode64,noquota)
- /dev/vda3 on /etc/hostname type xfs (rw,relatime,attr2,inode64,noquota)
- /dev/vda3 on /etc/hosts type xfs (rw,relatime,attr2,inode64,noquota)
- /dev/vda3 on /home/jenkins/xxxxxxxxxxxxx type xfs (rw,relatime,attr2,inode64,noquota)
再综合docker官方文档对xfs的要求描述:
Use the OverlayFS storage driver | Docker Documentation
对于xfs文件系统,需要在设置 d_type=true
即可解决问题
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。