0
0
Nginxdevops~5 mins

Container networking in Nginx - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AHost
BBridge
CNone
DOverlay
What does port mapping allow you to do?
AConnect container ports to host ports
BShare container files
CRun multiple containers
DCreate container images
In container networking, what is a 'network namespace'?
AA type of container
BA container image
CA storage volume
DA separate network environment for containers
Which command option maps port 80 of an nginx container to port 8080 on the host?
Adocker run -p 8080:80 nginx
Bdocker run -p 80:8080 nginx
Cdocker run --net=host nginx
Ddocker run -v 8080:80 nginx
Why might you use the 'host' network mode?
ATo create a private network bridge
BTo isolate container networking
CFor better network performance without isolation
DTo share files between containers
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.