docker 運行報錯:/bin/bash: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: Permission denied


轉自:https://www.cnblogs.com/wangzy-Zj/p/12797536.html

現象:啟動docker容器時,啟動不成功。顯示沒有權限

 

報錯如下:

 

 原因:共享庫沒有權限導致,如果是普通用戶,則嘗試切換到root用戶嘗試,如果是root用戶還是提示這個錯誤,就要檢查防火牆和SElinux

 

復制代碼
[root@localhost opt]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)
[root@localhost opt]# getenforce 
Enforcing
復制代碼

由此可知是SEliunx沒有關閉導致容器啟動失敗,臨時開發SELinux

[root@localhost opt]# setenforce 0
[root@localhost opt]# docker run -it centos /bin/bash
[root@eff214edebe5 /]#     #表明成功進入到容器中

啟動成功。建議永久關閉

復制代碼
[root@localhost ~]# vi /etc/selinux/config
....
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled    #改成disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
....
復制代碼

修改后需重啟服務器。

 

備注:具體問題需根據生產環境配置。以上僅供參考


免責聲明!

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



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