Home  >  Article  >  Operation and Maintenance  >  Docker container cannot access the host host

Docker container cannot access the host host

尚
Original
2020-03-24 17:23:332653browse

Docker container cannot access the host host

When the firewall is turned on, the host service cannot be accessed inside the docker container (services that can access other LAN computers other than the host). Solution:

1. Configure the firewall rule firewall-cmd --zone=public --add-port={port}/tcp --permanent, and reload the firewall rule firewall-cmd --reload

2. When starting the container Use --net host mode

3, turn off the firewall

For more related tutorials, please pay attention to the PHP Chinese websitedocker tutorial column.

The above is the detailed content of Docker container cannot access the host host. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn