Skip to content

Docker NetworksΒΆ

Container networking refers to the ability for containers to connect to and communicate with each other, or to non-Docker workloads.

To create a network, run:

docker network create my-network

If using Docker Swarm across multiple computers, you'll need to do:

docker network create -d overlay my-overlay-network
to allow the multiple Docker Daemons to communicate with each other.

Now, you can connect Docker containers to this network using:

docker network connect my-network my-container
or disconnect with:
docker network disconnect my-network my-container

In your docker-compose file, you can also specify the networks there as such:

version: '3.7'

services:
  frb-master:
    image: chimefrb/frb-master:latest
    networks:
      - frb_master_network

networks:
  frb_master_network:

Now, you can see all the connected services with:

docker network inspect my-network