0
0
Dockerdevops~20 mins

Creating custom bridge networks in Docker - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bridge Network Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Output of creating a custom bridge network
What is the output when you run the command to create a custom bridge network named my_bridge?
Docker
docker network create --driver bridge my_bridge
Aa1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
BError: network driver not found
CNetwork my_bridge already exists
D1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
Attempts:
2 left
💡 Hint
The command returns a network ID which is a long hexadecimal string.
🧠 Conceptual
intermediate
1:30remaining
Purpose of custom bridge networks
Why would you create a custom bridge network instead of using the default bridge network in Docker?
ATo isolate containers and control communication between them
BTo increase container CPU usage automatically
CTo disable container networking completely
DTo allow containers to use host network interfaces directly
Attempts:
2 left
💡 Hint
Think about network isolation and container communication control.
Configuration
advanced
2:00remaining
Correct Docker network create command with subnet
Which command correctly creates a custom bridge network named custom_net with subnet 192.168.100.0/24?
Adocker network create --driver bridge --subnet=192.168.100.0/24 custom_net
Bdocker network create --subnet 192.168.100.0/24 --driver=bridge custom_net
Cdocker network create custom_net --driver bridge --subnet 192.168.100.0/24
Ddocker network create --driver=bridge custom_net --subnet=192.168.100.0/24
Attempts:
2 left
💡 Hint
The subnet option uses an equals sign and comes after the driver option.
Troubleshoot
advanced
2:00remaining
Troubleshooting network creation failure
You run docker network create --driver bridge --subnet=192.168.1.0/24 mynet but get the error: Error response from daemon: Pool overlaps with other one on this address space. What is the most likely cause?
AThe network name mynet is invalid
BThe subnet 192.168.1.0/24 is already used by another Docker network
CThe bridge driver is not installed
DThe Docker daemon is not running
Attempts:
2 left
💡 Hint
The error mentions overlapping address space.
🔀 Workflow
expert
3:00remaining
Order of commands to create and use a custom bridge network
Put these steps in the correct order to create a custom bridge network and run a container attached to it:
A2,4,3,1
B3,2,4,1
C2,3,4,1
D1,2,3,4
Attempts:
2 left
💡 Hint
You must create the network before running containers on it.