Container Networking Vocabulary
5 exercises — Master the English vocabulary of container networking: network drivers, port binding, DNS service discovery, VXLAN overlays, and network isolation.
A developer asks: "I need the containers in my app — a web server, an API, and a cache — to communicate with each other on the same Docker host but be isolated from external network traffic unless I explicitly publish a port. Which Docker network driver should I use?"
Which driver is correct for this single-host, internal communication requirement?
Docker's built-in network drivers serve different purposes:
• bridge (default) — software bridge on the host; containers on the same bridge network communicate; isolated from host network unless ports are published via
-p• host — removes network namespace isolation; the container shares the host's network stack; better performance but zero network isolation
• overlay — multi-host networking across a Docker Swarm cluster; uses VXLAN encapsulation
• macvlan — containers appear as physical NICs on the LAN; used for apps needing direct L2 access (e.g., network appliances)
• none — no networking at all; used for maximum isolation or custom network setups
Key vocabulary:
• bridge network — a virtual network connecting containers on a single Docker host
• network driver — the software plugin that implements a specific networking topology in Docker
• published port — a host:container port mapping created with
-p that exposes a container port to external traffic• network namespace — the kernel isolation boundary that gives each container its own network stack
A docker run command includes the flag -p 8080:3000. A new team member asks: "I need to test the Node.js API from my browser. Which URL should I open?"
What is the correct answer?
The
-p 8080:3000 flag instructs Docker to forward traffic arriving at host port 8080 into the container at port 3000. From outside the container (your browser, curl, other services on the host), you always use the left-side number: localhost:8080. The application inside the container still listens on 3000 unchanged.The
EXPOSE Dockerfile instruction is often confused with port publishing. EXPOSE 3000 is documentation only — it tells humans and tooling which port the app uses, but it does NOT publish the port to the host. Only -p (or ports: in Compose) publishes a port.Key vocabulary:
• port binding — mapping a host port to a container port, published with
-p HOST:CONTAINER• host port — the port exposed on the Docker host machine (left side of the binding)
• container port — the port the application listens on inside the container (right side of the binding)
• EXPOSE — a Dockerfile instruction documenting the container's listening port; does NOT publish to the host
A microservices project uses Docker Compose. The api-gateway service's environment variable is set to PAYMENT_URL=http://payment-service:3000. When a teammate asks "How does the hostname payment-service resolve inside the api-gateway container?", the correct answer is:
Every container connected to a user-defined Docker network gets DNS configured to use Docker's embedded resolver at
127.0.0.11. This resolver maps container names and Compose service names to their current internal IP addresses. Because container IPs change on restart, resolving by name (not IP) is the correct approach.This service discovery is network-scoped: only containers on the same Docker network can resolve each other by name. In Docker Swarm, the embedded DNS also provides virtual IP (VIP) load balancing across service replicas transparently.
Key vocabulary:
• embedded DNS — Docker's built-in resolver (127.0.0.11) that resolves container and service names to IPs
• service discovery — the ability for services to locate each other by name without hardcoded IP addresses
• DNS alias — Docker Compose assigns each service's name as a DNS alias resolvable within the same network
• network scope — container name DNS resolution is scoped to the containers sharing the same Docker network
A Docker Swarm architect says: "We need containers on different physical hosts to communicate as if they're on the same LAN. We'll create an overlay network — it tunnels container traffic between hosts using VXLAN encapsulation."
What does VXLAN encapsulation provide?
VXLAN (Virtual Extensible LAN) solves the problem of running a virtual L2 network across physical L3 infrastructure. It encapsulates Ethernet frames in UDP datagrams with a VTEP (VXLAN Tunnel End Point) header. Containers on
host-A and host-B communicate as if they share one Ethernet segment — the physical L3 network between the hosts is transparent to them.Docker Swarm uses VXLAN-based overlay networks for all cross-node container communication. Kubernetes CNI plugins (Flannel, Calico BGP-less mode) use similar tunnelling. VXLAN does NOT provide encryption by default — a separate layer (WireGuard, IPsec, mutual TLS) is needed for encrypted overlay networks.
Key vocabulary:
• overlay network — a virtual network built on top of an existing physical network infrastructure
• VXLAN — Virtual Extensible LAN; encapsulates Ethernet frames in UDP for cross-host container networking
• VTEP — VXLAN Tunnel End Point; the host-level component that encapsulates and decapsulates VXLAN traffic
• multi-host networking — container communication spanning multiple Docker hosts or Kubernetes nodes
• encapsulation — wrapping a network frame inside another packet to traverse an incompatible network
A security review reports: "Container A (payment service) can reach Container B (internal admin panel) because they're on the same default bridge network. The payment service should have no route to the admin panel — place them on separate networks."
Which statement best describes how Docker network isolation works?
Docker's network model enforces isolation at the network boundary. Create separate networks for different trust domains — e.g., a
frontend network, a backend network, a db network — and connect each container only to the networks it legitimately needs. This is network micro-segmentation without writing iptables or firewall rules manually.A container that needs to bridge two segments (e.g., an API gateway connecting frontend to backend) can be attached to both networks explicitly. Best practice: no container should be connected to networks it doesn't use — this limits blast radius if a container is compromised.
Key vocabulary:
• network micro-segmentation — dividing a network into small isolated segments with controlled access between them
• least-privilege networking — connecting a container only to the networks it actually needs
• intra-network communication — traffic between containers sharing the same Docker network (permitted by default)
• cross-network communication — traffic between containers on different Docker networks (blocked by default)
• blast radius — the scope of impact if a single container or service is compromised
During a code review for a new feature implementing containerized microservices, Sarah mentions that her team is using Docker Compose to orchestrate their services. She explains that they've created custom networks to allow specific service communication while isolating them from the host's network and other services. Mark, a junior developer, asks: 'I need to debug my application running in a container. How can I access shell commands within the container without exposing it directly to the host or the internet?' Which approach is most appropriate for debugging a single container?
docker exec. This command allows you to execute commands within a running container's environment without modifying the container itself or exposing it to external networks. Options B and D are incorrect because they involve port exposure or creating a separate debugging container which isn't the most efficient method for immediate shell access. Option C is also wrong as docker exec provides direct shell access, not network connection through a new named network.Alex: "Hey team, I'm deploying a new service that needs to access our database. It's running in a container and we want to ensure it's securely isolated from the rest of the network. We're using Kubernetes. What's the best way to achieve this?"Liam: "Okay team, we've just deployed a new service, EchoService, that needs to regularly ping an external monitoring endpoint. We're using Docker Compose and want the EchoService container to be able to make these outbound connections without any firewall restrictions within our Docker network. What is the *most* appropriate way to configure this?"EchoService's outbound traffic from the host and other containers, preventing unintended connections and simplifying firewall configurations. Options A and B are incorrect because they don't leverage Docker's networking features for isolation; option C is also wrong as using the bridge driver with a custom network provides the necessary control over routing.David, a senior engineer, says: 'Let's investigate! We need to ensure our frontend can communicate with the backend, but we also want to maintain security.'
api_gateway isn't always able to find web_app. What could be causing this intermittent resolution problem?'
During a code review for a new feature implementing containerized microservices, Sarah mentions that her team is using Docker Compose to orchestrate their services. She explains that they've created custom networks to allow specific service communication while isolating them from the host's network and other services. Mark, a junior developer, asks: 'I need to debug my application running in a container. How can I access shell commands within the container without exposing it directly to the host or the internet?' Which approach is most appropriate for debugging a single container?
docker exec. This command allows you to execute commands within a running container's environment without modifying the container itself or exposing it to external networks. Options B and D are incorrect because they involve port exposure or creating a separate debugging container which isn't the most efficient method for immediate shell access. Option C is also wrong as docker exec provides direct shell access, not network connection through a new named network.Alex: "Hey team, I'm deploying a new service that needs to access our database. It's running in a container and we want to ensure it's securely isolated from the rest of the network. We're using Kubernetes. What's the best way to achieve this?"Liam: "Okay team, we've just deployed a new service, EchoService, that needs to regularly ping an external monitoring endpoint. We're using Docker Compose and want the EchoService container to be able to make these outbound connections without any firewall restrictions within our Docker network. What is the *most* appropriate way to configure this?"EchoService's outbound traffic from the host and other containers, preventing unintended connections and simplifying firewall configurations. Options A and B are incorrect because they don't leverage Docker's networking features for isolation; option C is also wrong as using the bridge driver with a custom network provides the necessary control over routing.David, a senior engineer, says: 'Let's investigate! We need to ensure our frontend can communicate with the backend, but we also want to maintain security.'
api_gateway isn't always able to find web_app. What could be causing this intermittent resolution problem?'
During a code review for a new feature implementing containerized microservices, Sarah mentions that her team is using Docker Compose to orchestrate their services. She explains that they've created custom networks to allow specific service communication while isolating them from the host's network and other services. Mark, a junior developer, asks: 'I need to debug my application running in a container. How can I access shell commands within the container without exposing it directly to the host or the internet?' Which approach is most appropriate for debugging a single container?
docker exec. This command allows you to execute commands within a running container's environment without modifying the container itself or exposing it to external networks. Options B and D are incorrect because they involve port exposure or creating a separate debugging container which isn't the most efficient method for immediate shell access. Option C is also wrong as docker exec provides direct shell access, not network connection through a new named network.Alex: "Hey team, I'm deploying a new service that needs to access our database. It's running in a container and we want to ensure it's securely isolated from the rest of the network. We're using Kubernetes. What's the best way to achieve this?"Liam: "Okay team, we've just deployed a new service, EchoService, that needs to regularly ping an external monitoring endpoint. We're using Docker Compose and want the EchoService container to be able to make these outbound connections without any firewall restrictions within our Docker network. What is the *most* appropriate way to configure this?"EchoService's outbound traffic from the host and other containers, preventing unintended connections and simplifying firewall configurations. Options A and B are incorrect because they don't leverage Docker's networking features for isolation; option C is also wrong as using the bridge driver with a custom network provides the necessary control over routing.David, a senior engineer, says: 'Let's investigate! We need to ensure our frontend can communicate with the backend, but we also want to maintain security.'
api_gateway isn't always able to find web_app. What could be causing this intermittent resolution problem?'
During a code review for a new feature implementing containerized microservices, Sarah mentions that her team is using Docker Compose to orchestrate their services. She explains that they've created custom networks to allow specific service communication while isolating them from the host's network and other services. Mark, a junior developer, asks: 'I need to debug my application running in a container. How can I access shell commands within the container without exposing it directly to the host or the internet?' Which approach is most appropriate for debugging a single container?
docker exec. This command allows you to execute commands within a running container's environment without modifying the container itself or exposing it to external networks. Options B and D are incorrect because they involve port exposure or creating a separate debugging container which isn't the most efficient method for immediate shell access. Option C is also wrong as docker exec provides direct shell access, not network connection through a new named network.Alex: "Hey team, I'm deploying a new service that needs to access our database. It's running in a container and we want to ensure it's securely isolated from the rest of the network. We're using Kubernetes. What's the best way to achieve this?"Liam: "Okay team, we've just deployed a new service, EchoService, that needs to regularly ping an external monitoring endpoint. We're using Docker Compose and want the EchoService container to be able to make these outbound connections without any firewall restrictions within our Docker network. What is the *most* appropriate way to configure this?"EchoService's outbound traffic from the host and other containers, preventing unintended connections and simplifying firewall configurations. Options A and B are incorrect because they don't leverage Docker's networking features for isolation; option C is also wrong as using the bridge driver with a custom network provides the necessary control over routing.David, a senior engineer, says: 'Let's investigate! We need to ensure our frontend can communicate with the backend, but we also want to maintain security.'
api_gateway isn't always able to find web_app. What could be causing this intermittent resolution problem?'Frequently Asked Questions
What does the "Container Networking Vocabulary" exercise practise?
Practice container networking vocabulary in English: Docker network drivers, port binding, embedded DNS, VXLAN overlay networks, and network isolation. 5 advanced exercises.
How many questions are in this exercise?
This exercise has 25 questions, each multiple-choice with a full explanation shown after you answer.
What English level is this exercise for?
This exercise is tagged Advanced. If the vocabulary feels difficult, browse the Containers & Virtualization category page for an easier module to start with.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free with no account, sign-up, or paywall.
Do I get feedback if I answer incorrectly?
Yes — whichever option you choose, right or wrong, you'll immediately see an explanation clarifying the correct term and why the other options don't fit.
Can I retry this exercise?
Yes — once you finish all the questions, a "Try again" button on the results screen resets the exercise so you can practise as many times as you like.
Do I need an account to track my progress?
No account is required. Your progress bar and score for this session are tracked in the browser as you go, but nothing is saved once you leave the page.
Is "Container Networking Vocabulary" part of a larger series?
Yes — it's one exercise in the Containers & Virtualization category on CoderSlingo. See the category page for the full list of related exercises on similar terminology.
Can I link directly to this exercise?
Yes — this exercise has its own permanent URL, so you can bookmark it or share the link directly with a colleague or study partner.
Where can I find more exercises like this one?
See the Containers & Virtualization category page for related exercises, or browse the main Exercises hub for other IT English topics.