The Commands

This lesson lists all the relevant Docker network commands with brief reminders of what each one does.

Docker networking has its own docker network sub-command. The main commands include:

  • docker network ls lists all networks on the local Docker host.

  • docker network create creates new Docker networks. By default, it creates them with the nat driver on Windows and the bridge driver on Linux. You can specify the driver (type of network) with the -d flag. docker network create -d overlay overnet will create a new overlay network called overnet with the native Docker overlay driver.

  • docker network inspect provides detailed configuration information about a Docker network.

  • docker network prune deletes all unused networks on a Docker host.

  • docker network rm deletes specific networks on a Docker host.

Get hands-on with 1400+ tech skills courses.