2022-08-29 Podman for CentOS7

遇到的错误提示

cannot clone: Invalid argument
user namespaces are not enabled in /proc/sys/user/max_user_namespaces
Error: could not get runtime: cannot re-exec process

解决方法

CentOS 7 requires running the following commands as root:

echo 'user.max_user_namespaces=10000' > /etc/sysctl.d/42-rootless.conf
sysctl --system

问题1:

user namespaces are not enabled in /proc/sys/user/max_user_namespaces

解决办法

# centos 7默认关闭了 user namespace,需要手动打开
echo 10000 > /proc/sys/user/max_user_namespaces
grubby --args="user_namespace.enable=1" --update-kernel="$(grubby --default-kernel)"
echo "user.max_user_namespaces=10000" >> /etc/sysctl.conf
# 普通用户
echo $USER
sudo usermod --add-subuids 10000-65535 $USER
sudo usermod --add-subgids 10000-65535 $USER
#
echo USERNAME:10000:65535 >> sudo tee /etc/subuid
echo USERNAME:10000:65535 >> sudo tee /etc/subgid

镜像源顺序

vi /etc/containers/registries.conf

# 把docker.io 放到最前面
unqualified-search-registries = ["docker.io", "registry.fedoraproject.org", "registry.access.redhat.com", "registry.centos.org"]

作者:rekca
链接:https://www.jianshu.com/p/7b1be93ef3d7
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

猜你喜欢

转载自blog.csdn.net/liuqun69/article/details/127548936