Complete the code to list all Docker networks on your system.
docker network [1]The docker network ls command lists all networks available in Docker. This helps you see how containers can connect.
Complete the command to connect a running container named 'webapp' to a network called 'frontend'.
docker network connect [1] webappThe docker network connect frontend webapp command connects the 'webapp' container to the 'frontend' network, allowing it to communicate with other containers on that network.
Fix the error in the command to create a new Docker network named 'mynetwork' with the bridge driver.
docker network create --driver [1] mynetworkThe bridge driver creates a private internal network on the host. Using --driver bridge is the correct way to create a bridge network.
Fill both blanks to run a container named 'db' attached to the 'backend' network and expose port 5432.
docker run -d --name db --network [1] -p [2]:5432 postgres
The container runs on the 'backend' network and exposes port 5432, which is the default port for PostgreSQL.
Fill all three blanks to create a user-defined bridge network named 'appnet', run a container named 'app' on it, and connect another container named 'worker' to the same network.
docker network [1] appnet && docker run -d --name app --network [2] nginx && docker network [3] appnet worker
First, create the network with create. Then run the 'app' container on that network. Finally, connect the 'worker' container to 'appnet' using connect.