Interview Q&A / Docker & Kubernetes

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What are the bridge, host and none network modes in Docker?

SHORT ANSWER

bridge (default) gives a container its own network and IP behind a virtual switch, host shares the host's network stack with no isolation, and none disables networking except loopback.

Explain it simply

Picture a college hostel. Bridge mode is each student in their own room on a shared corridor, reaching the outside through the main gate. Host mode is the student sleeping in the warden's room, using the warden's phone line. None is a room with no door at all.

With bridge, Docker creates a virtual switch on the host. Each container gets a private IP, and -p rules forward host ports to it. With host (--network host), the container uses the host's IP and ports directly, so -p is ignored and port clashes are possible. It is faster but not isolated, and works as expected on Linux (Docker Desktop behaves differently). With none, the container has only a loopback interface, useful for offline batch jobs and tight isolation.

For several containers talking to each other, create your own bridge network.

Example

bash
docker run -d --network bridge  nginx    # default
docker run -d --network host    nginx    # uses host port 80 directly
docker run -d --network none    alpine sleep 600
docker network ls

What to say in the interview

"bridge is the default private network with port mapping, host removes network isolation by sharing the host stack, and none leaves only loopback. I use user-defined bridge networks for multi-container apps."

Common mistakes

  • Combining --network host with -p and expecting port mapping to work.

#docker#networking

Related questions

Practise more Docker & Kubernetes questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Docker & Kubernetes quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.