05A - Docker Networking

EntrancedDobro6607 avatar
EntrancedDobro6607
·
·
Download

Start Quiz

Study Flashcards

18 Questions

What is the purpose of using the '--network none' option in Docker?

Isolating a container from any network

When is port forwarding necessary in Docker containers?

When external traffic needs to access services inside a container

How does the bridge network in Docker relate to port forwarding?

Port forwarding is used alongside the bridge network for external access

Why is port forwarding not necessary in the host network mode in Docker?

Containers share host's network interfaces directly

How does the '-p 8080:80' command in 'docker run' help with port forwarding?

Maps port 8080 from host to port 80 inside the container

Which Docker option completely isolates a container from any network?

--network none

What is the purpose of a bridge network in Docker?

Allows containers on the same network to communicate

Which command is used to create a custom bridge network in Docker?

docker network create --driver bridge

What command is used to connect an existing container to a bridge network?

docker network connect my_bridge_network existing_container

What does the host network in Docker allow?

Containers to communicate with the host system

In the host network mode, do containers have direct access to the host's ports?

Yes, containers use the host's networking directly.

How are containers connected on a bridge network able to communicate?

Through private internal network on the host

When running a container, how can you connect it to a specific bridge network?

docker run -d --name container1 --network my_bridge_network nginx

Which type of network is ideal for running a web server that needs direct access to the host's IP address and ports?

Host Network

What does the 'None Network' option do when configured for a container?

Disables networking for the container completely.

When using the host network stack, what does a container share with the Docker host?

Host's networking directly

Which command is used to start a container on the host network stack from the nginx image?

docker run -d --name host_container --network host nginx

What happens when a container is attached to a specific bridge network in Docker?

It enables communication with other containers on the same network

Learn about Docker networking, including how to create custom networks using the docker network create command. Discover how custom networks provide more control over network settings and enable inter-container communication. Explore how containers on the same network can communicate with each other and how port mappings allow external access.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser