What is the main effect of running a Docker container with --network host option?
Think about what it means to share the host's network stack.
Using --network host makes the container use the host's network directly, so it does not get its own IP or isolated namespace.
What is the output of docker network inspect host on a typical Linux system?
docker network inspect hostHost network uses the 'host' driver and local scope.
The host network is a special network with driver 'host' and local scope, and it usually has no containers listed inside.
You want to run a container that uses the host network and expose port 8080. Which command will correctly run the container?
When using host networking, port mapping is not needed.
With host networking, the container shares the host's ports directly, so -p is ignored and unnecessary.
You run two containers with --network host and both try to listen on port 80. What will happen?
Think about how host networking shares the host's ports.
Since both containers share the host's network, only one can bind to port 80. The second container will fail to bind and start.
Which of the following is the best security practice when using Docker host networking mode?
Consider how host networking affects container isolation.
Host networking reduces network isolation, increasing security risks. It should be used only when needed.