redhat7.4 docker run啟動容器報錯container_linux.go:449


問題現象:

在redhat服務器上使用docker run啟動容器時報錯:docker: Error response from daemon: OCI runtime create failed: container_linux.go:449;container init caused "write /proc/self/attr/keycreate: permission denied"": unknown.

問題原因:由於操作系統已啟用SELinux,造成“/proc/self/attr/keycreate” 沒有寫入權限 使用命令:getenfor查看SELinux運行模式
復制代碼

root@localhost ~]# getenforce

查詢SELinux的運行模式

Enforcing

當前的SELinux是強制模式

[root@localhost ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted

復制代碼

解決辦法:

1 永久方法 – 需要重啟服務器

修改/etc/selinux/config文件中設置SELINUX=disabled ,然后重啟服務器。

2 臨時方法 – 設置系統參數

使用命令setenforce 0

附:
setenforce 1 //設置SELinux 成為enforcing模式
setenforce 0 //設置SELinux 成為permissive模式

原文:https://www.cnblogs.com/jamyxu/p/12641453.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM