centos docker 端口映射无法访问

1 centos关闭防火墙

systemctlstopfirewalld.service

systemctl disable firewalld.service

2 关闭selinux

进入到/etc/selinux/config文件

vi /etc/selinux/config

将SELINUX=enforcing改为SELINUX=disabled

3 /etc/sysctl.conf添加如下

nano /etc/sysctl.conf

# net.bridge.bridge-nf-call-ip6tables = 1

net.bridge.bridge-nf-call-iptables = 1

net.ipv4.ip_forward=1

net.ipv6.conf.all.disable_ipv6=1

4 重启网络,重启docker

systemctl restart network

systemctl restart docker

你可能感兴趣的:(centos docker 端口映射无法访问)