Docker container cannot access the host host

Release: 2020-03-24 17:23:33
Original
2598 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!