DEV Community

Pheak Pheasa
Pheak Pheasa

Posted on

To create a Docker network

docker network create [OPTIONS] NETWORK_NAME
Enter fullscreen mode Exit fullscreen mode

For example, to create a bridge network named "my-network", you can use:

docker network create my-network
Enter fullscreen mode Exit fullscreen mode

You can also specify additional options such as the driver type, subnet, gateway, and more if needed. For instance:

docker network create \
  --driver bridge \
  --subnet 172.20.0.0/16 \
  --gateway 172.20.0.1 \
  my-network
Enter fullscreen mode Exit fullscreen mode

Top comments (0)