Creating user-defined bridge networks
When you create a new user-defined network, you can supply most of the standard IP options that you would use when creating a new network outside of Docker. You can set options for the subnet, IP range, and gateway. Remember that the network you define here is only internal to your Docker host and that the IP addresses you assign will not be addressable outside the host. To read about more advanced options, you can visit the advanced Docker networking page at https://docs.docker.com/engine/reference/commandline/network_create/#specify-advanced-options.
To create a user-defined network, we use the network management
option in the Docker CLI, along with the create
option. The syntax is very simple; you only need to provide the desired network name for the new network and Docker will create the new network. To create a new network called frontend, we simply need to execute the following command: