ctr: failed to extract layer … failed to unmount … operation not permitted: unknown
问题背景:
在pod的container中执行ctr image import命令时报错 failed to extract layer … failed to unmount … operation not permitted: unknown。
问题解决:
容器没有真正拥有root用户权限 需要设置pod属性:pod.spec.containers.securityContext.privileged = true (特权模式)
privileged <boolean>
Run container in privileged mode. Processes in privileged containers are
essentially equivalent to root on the host. Defaults to false.
如果是docker run起容器,添加 --privileged