当前目录中有大约 10 个容器映像文件,我想将它们加载到使用 containerd 作为 CRI 的 Kubernetes 集群中。
[root@test tmp]# ls -1
test1.tar
test2.tar
test3.tar
...
我尝试使用 xargs 一次加载它们,但得到以下结果:
[root@test tmp]# ls -1 | xargs nerdctl load -i
unpacking image1:1.0 (sha256:...)...done
[root@test tmp]#
第一个 tar 文件已成功加载,但命令退出,剩余的 tar 文件未处理。
我已确认命令nerdctl load -i
成功,退出代码为 0。
[root@test tmp]# nerdctl load -i test1.tar
unpacking image1:1.0 (sha256:...)...done
[root@test tmp]# echo $?
0
有人知道原因吗?