79308345

Date: 2024-12-25 21:35:04
Score: 1
Natty:
Report link

Docker documentation about bridge networking(https://docs.docker.com/engine/network/drivers/bridge/) :

For Docker, a bridge network uses a software bridge which allows containers connected to the same bridge network to communicate, while providing isolation from containers which are not connected to that bridge network.

Docker documentation about host networking (https://docs.docker.com/engine/network/drivers/host/) :

If you use the host network driver for a container, that container’s network stack is not isolated from the Docker host. For instance, if you run a container which binds to port 445 and you use host networking, the container’s application will be available on port 445 on the host’s IP address.

If you want to deploy multiple containers connected between them with a private internal network use bridge networking. If you want to deploy a container connected to the same network stack as the host (and access the same networks as the host) use host networking. And, if you want to publish some ports, run the container with the --publish or -p option, such as -p 445:445.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Hadrien Valet