Member-only story

Docker Network Commands

Meghasharmaa
8 min readApr 10, 2024

The docker network command is used to manage Docker networks. It allows you to create, inspect, list, connect, disconnect, and remove Docker networks. Below are some common subcommands and examples of using the docker network command:

👉List Docker Networks:

This command provides a list of all networks created on your Docker host. Here’s how you can use it:

docker network ls

When you run this command, Docker will output a table with information about each network, including its ID, name, driver, and scope (local or global). The output will look something like this:

NETWORK ID     NAME            DRIVER    SCOPE
abcdef123456 bridge bridge local
ghijkl789012 host host local
mnopqr345678 my-network bridge local
stuvwx901234 my-overlay-net overlay swarm

In this example output:

  • NETWORK ID: Unique identifier for each network.
  • NAME: Name of the network.
  • DRIVER: The type of driver used for the network (e.g., bridge, overlay, host).
  • SCOPE: Specifies whether the network is local (only accessible on the current host) or global (accessible across multiple hosts in a swarm).

--

--

Meghasharmaa
Meghasharmaa

Written by Meghasharmaa

DevOps Architect | AWS | Docker | Kubernetes | Terraform | Google Cloud | Python

No responses yet