Recall & Review
beginner
What is container networking?
Container networking is the way containers communicate with each other and with the outside world, allowing them to send and receive data over networks.
Click to reveal answer
beginner
Name a common network mode used by containers.
Bridge network mode is common; it creates a private network internal to the host where containers can communicate.
Click to reveal answer
beginner
What does port mapping do in container networking?
Port mapping connects a port on the host machine to a port inside the container, allowing external access to container services.
Click to reveal answer
intermediate
How does the 'host' network mode differ from 'bridge' mode?
In 'host' mode, the container shares the host's network stack directly, so no isolation exists. In 'bridge' mode, containers have their own network namespace.
Click to reveal answer
beginner
Why is container networking important for running nginx inside a container?
Because nginx needs to listen on network ports to serve web pages, container networking allows nginx to receive requests and send responses properly.
Click to reveal answer
Which network mode isolates container networking from the host?
✗ Incorrect
Bridge mode creates a private network for containers, isolating them from the host network.
What does port mapping allow you to do?
✗ Incorrect
Port mapping connects a container's port to a port on the host, enabling external access.
In container networking, what is a 'network namespace'?
✗ Incorrect
A network namespace isolates the container's network stack from others.
Which command option maps port 80 of an nginx container to port 8080 on the host?
✗ Incorrect
The syntax -p hostPort:containerPort maps host port 8080 to container port 80.
Why might you use the 'host' network mode?
✗ Incorrect
Host mode shares the host network stack, improving performance but removing isolation.
Explain how port mapping works in container networking and why it is useful for running nginx.
Think about how a web browser reaches nginx inside a container.
You got /3 concepts.
Describe the difference between bridge and host network modes in containers.
Consider how containers see the network in each mode.
You got /3 concepts.