
报错docker pull 拉取镜像失败报错主要内容是Check /etc/subuid and /etc/subgid: lchown /etc/gshadow: invalid argumentdockerpull docker.io/library/nginx Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. Trying to pull docker.io/library/nginx:latest... Getting imagesourcesignatures Copying blob b6698f04e005doneCopying blob 2bedaf25031adoneCopying blob cacfcdd01f30doneCopying blob 062e450697fadoneCopying blob 3c7ab7949321doneCopying blob 82454cdbf456doneCopying blob d26f27cc8c41doneError: writing blob: adding layer with blobsha256:062e450697faa5f02a3a74eba9864ee4d79bc9cfbd65769fc6cdff2c05c6a053:Error processingtarfile(exit status1): potentially insufficient UIDs or GIDs availableinuser namespace(requested0:42for/etc/gshadow): Check /etc/subuid and /etc/subgid: lchown /etc/gshadow: invalid argument解决方法将当前用户添加到/etc/subuid和·/etc/subgid即可检查一下所有已使用的subordinate UID段awk-F:{print $2, $2$3-1}/etc/subuid|sort-n会输出如下100007553510000755351000075535100000165535165536231071231072296607296608362143362144427679427680493215493216558751558752624287624288689823根据这段输出挑选出一个未被使用的subordinate UID段例如可以这样分析一段空闲范围已用范围结束1000075535← 已用7553699999空闲但不够 65536100000755359← 已用755360820895完全空闲因此我选择使用755360:65536段添加到/etc/subuid和·/etc/subgidsudosh-cecho {username}:755360:65536 /etc/subuid echo {username}:755360:65536 /etc/subgid刷新 Podman 配置并清理残留podmansystem migrate