Docker 容器映射, 容器启动成功,外部访问不到问题解决

使用命令查看:
桥接模式没有打开的两个报错

[root@localhost bin]# docker info
Containers: 11
 Running: 3
 Paused: 0
 Stopped: 8
Images: 8
Server Version: 1.13.1
Storage Driver: overlay2
 Backing Filesystem: xfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: journald
Cgroup Driver: systemd
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: docker-runc runc
Default Runtime: docker-runc
Init Binary: /usr/libexec/docker/docker-init-current
containerd version:  (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1)
runc version: 66aedde759f33c190954815fb765eedc1d782dd9 (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f)
init version: fec3683b971d9c3ef73f284f176672c44b448662 (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
 seccomp
  WARNING: You're not using the default seccomp profile
  Profile: /etc/docker/seccomp.json
 selinux
Kernel Version: 3.10.0-1062.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 3
CPUs: 1
Total Memory: 972.4 MiB
Name: localhost.localdomain
ID: WGIS:AKHH:HIQP:J6MO:UJU6:PZJM:DAQH:DXRX:S2NR:6V5O:T7BP:JYE2
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Experimental: false
Insecure Registries:
 127.0.0.0/8
Registry Mirrors:
 https://bjx7s2fz.mirror.aliyuncs.com
Live Restore Enabled: false
Registries: docker.io (secure)
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

使用命令:

vi /etc/sysctl.conf

在最后增加两行,保存退出
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1

查看设置:

sysctl -p
docker info

在这里插入图片描述
告警消失,重启系统。

容器启动可以正常访问,完美解决

猜你喜欢

转载自blog.csdn.net/qq_16183731/article/details/120230558
今日推荐