0
0
Dockerdevops~10 mins

Bridge network default behavior in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to list all Docker networks.

Docker
docker network [1]
Drag options to blanks, or click blank then click option'
Als
Binspect
Crm
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' instead of 'ls' will try to make a new network.
'rm' deletes a network, not lists it.
2fill in blank
medium

Complete the command to create a new bridge network named 'mybridge'.

Docker
docker network create --driver [1] mybridge
Drag options to blanks, or click blank then click option'
Ahost
Bnone
Cbridge
Doverlay
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'host' connects containers directly to the host network.
'overlay' is for multi-host networking.
3fill in blank
hard

Fix the error in the command to inspect the default bridge network.

Docker
docker network [1] bridge
Drag options to blanks, or click blank then click option'
Ainspect
Brm
Cls
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ls' lists networks but does not show details.
'rm' deletes the network, which is not intended here.
4fill in blank
hard

Fill both blanks to create a container named 'web' attached to the default bridge network.

Docker
docker run --name [1] --network [2] -d nginx
Drag options to blanks, or click blank then click option'
Aweb
Bhost
Cbridge
Dmybridge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'host' network changes container networking behavior.
Using 'mybridge' is a custom network, not default.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps container names to their IP addresses from a list 'containers'.

Docker
container_ips = {{ [1]: [2] for [3] in containers }}
Drag options to blanks, or click blank then click option'
Acontainer.name
Bcontainer.attrs['NetworkSettings']['IPAddress']
Ccontainer
Dcontainer.id
Attempts:
3 left
💡 Hint
Common Mistakes
Using container.id as key instead of name.
Using wrong attribute for IP address.