Home > Article > Operation and Maintenance > 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!