当前位置:   article > 正文

2022-08-29 Podman for CentOS7

jenkins user namespaces are not enabled in /proc/sys/user/max_user_namespace

遇到的错误提示

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

解决方法

CentOS 7 requires running the following commands as root:

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

问题1:

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

解决办法

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

镜像源顺序

vi /etc/containers/registries.conf

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

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/159066
推荐阅读
相关标签
  

闽ICP备14008679号