...

/

Docker CLI: Docker Networks

Docker CLI: Docker Networks

Learn useful Docker CLI commands related to Docker networks.

Define a Docker network

Using a Docker network allows containers to communicate with each other using their container name (--name) rather than an IP address.

To delete or create a network we can use the following:

docker network create --driver bridge <network_name>

For example, to create a network named mynet, we can use:

docker network create --driver bridge
...