我的 Manjaro 安装没有配置/etc/subuid
and /etc/subgid
Docker 等无根容器工作所需的文件。
例如cat /etc/subuid
返回文件未找到错误。
我一安装 Docker Desktop 就发现了这个问题,并且花了很长时间才启动。
我听从了一些建议this https://github.com/docker/desktop-linux/issues/43#issuecomment-1178652998页面但无济于事,因为我的系统没有必需的文件。
最终,我弄清楚了如何创建和配置 subuid 和 subgid 文件。我在下面提供了解决方案。
创造/etc/subuid
and /etc/subgid
文件,使用
touch /etc/subuid
touch /etc/subgid
为了配置文件,我使用了编写的 Python 程序,如下所述here https://rootlesscontaine.rs/getting-started/common/subuid/:
f = open("/etc/subuid", "w")
for uid in range(1000, 65536):
f.write("%d:%d:65536\n" %(uid,uid*65536))
f.close()
f = open("/etc/subgid", "w")
for uid in range(1000, 65536):
f.write("%d:%d:65536\n" %(uid,uid*65536))
f.close()
您可以使用以下命令验证这些文件的存在和内容cat /etc/subuid
Docker 现在可以完美运行了!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)