standard_init_linux.go:178: exec user process caused "operation not permitted”

是用Rancher 部署应用时碰到的坑:
rancher v2.1.2
standard_init_linux.go:178: exec user process caused "operation not permitted”

standard_init_linux.go:178: exec user process caused "operation not permitted”

解决方案:

#在你的主机里,查找/etc目录下的sysconfig/docker文件,然后将--selinux-enabled 删除 或者--selinux-disabled
vi /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi

# Do not add registries in this file anymore. Use /etc/containers/registries.conf
# instead. For more information reference the registries.conf(5) man page.

# Location used for temporary files, such as those created by
# docker load and build operations. Default is /var/lib/docker/tmp
# Can be overriden by setting the following environment variable.
# DOCKER_TMPDIR=/var/tmp

# Controls the /etc/cron.daily/docker-logrotate cron job status.
# To disable, uncomment the line below.
# LOGROTATE=false

# docker-latest daemon can be used by starting the docker-latest unitfile.
# To use docker-latest client, uncomment below lines
#DOCKERBINARY=/usr/bin/docker-latest
#DOCKERDBINARY=/usr/bin/dockerd-latest
#DOCKER_CONTAINERD_BINARY=/usr/bin/docker-containerd-latest
#DOCKER_CONTAINERD_SHIM_BINARY=/usr/bin/docker-containerd-shim-latest

删除后是这样的:

OPTIONS='--log-driver=journald --signature-verification=false'

然后重新启动docker,应用自动会部署成功:

sudo systemctl daemon-reload 
sudo systemctl restart docker

分析:
selinux是什么:

安全增强型 Linux(Security-Enhanced Linux)简称 SELinux,它是一个 Linux 内核模块,也是 Linux 的一个安全子系统

&:SELinux 的作用及权限管理机制
SELinux 主要作用就是最大限度地减小系统中服务进程可访问的资源(最小权限原则)。
设想一下,如果一个以 root 身份运行的网络服务存在 0day 漏洞,黑客就可以利用这个漏洞,以 root 的身份在您的服务器上为所欲为了。是不是很可怕?
SELinux 就是来解决这个问题的。

selinux 开启和关闭

所有function都支持 – Selinux在没有指定新的权限的情况下工作。 当守护程序在没有selinux支持的情况下运行时,没有新的权限可以使用。 宽容vs强制模式没有效果。

Docker中阻止selinux转换的无新特权的解决方法,可以详细讨论下,目前的解决办法,就是禁用。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

[shenhonglei]

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值