Skip to main content

Network Commands

Multi-container communication relies on networks. Docker offers several drivers: bridge (default), host, none, and a custom bridge scoped per project.

List and create​

Linux
docker network ls
docker network create ros-net

Attach containers to a network​

Connect a container to a custom network so it can reach others by container name (automatic DNS resolution):

Linux
docker run -d --name ros-node --network ros-net ros:humble
tip

Compose networks automatically

With docker compose, Compose creates a bridge network per project, and services talk to each other by their services name — no manual docker network create needed. See Compose Commands.

Inspect network details​

Linux
docker network inspect ros-net
Join Us