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
docker network lsdocker network create ros-netAttach containers to a network
Connect a container to a custom network so it can reach others by container name (automatic DNS resolution):
docker run -d --name ros-node --network ros-net ros:humbletip
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
docker network inspect ros-net