Centos7安装docker注意事项

  1. 查看centos版本
cat /etc/redhat-release 
  1. 安装docker前先关掉firewalld防火墙
systemctl stop firewalld
  1. 禁止开机启动firewalld防火墙
systemctl disable firewalld

4.关闭seclinux,重启 .

getenforce
//查看
cat /etc/selinux/config

永久关闭 selinux

修改selinux的配置文件,重启后生效。

  1. 打开 selinux 配置文件
[root@localhost ~]# vim /etc/selinux/config
  1. 修改 selinux 配置文件
    SELINUX=enforcing改为SELINUX=disabled,保存后退出
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

此时获取当前selinux防火墙的安全策略仍为Enforcing,配置文件并未生效。

[root@localhost ~]# getenforce
Enforcing
  1. 重启
[root@localhost ~]# reboot
  1. 验证
[root@localhost ~]# /usr/sbin/sestatus
SELinux status:                 disabled

[root@localhost ~]# getenforce
Disabled
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容