Networks
Part of the Introduction to Docker section of Coddy's Terminal journey — lesson 31 of 40.
Docker uses networks to control how containers talk to each other and to the outside world. List the existing networks with docker network ls:
docker network lsEvery Docker setup starts with three built-in networks: bridge (the default), host, and none. You can create your own network for a group of containers to share:
docker network create mynetThe three built-in networks are protected: Docker will refuse to remove them, because the system depends on them.
Challenge
BeginnerCreate a network named backend, then list all networks to confirm both your network and the built-in bridge network are present.
Cheat sheet
Docker networks control how containers communicate with each other and the outside world.
List existing networks:
docker network lsCreate a custom network:
docker network create mynetEvery Docker setup includes three built-in networks: bridge (default), host, and none. These cannot be removed.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.