| Command for overlay network | This is used to establish a distributed network between many Docker daemon hosts. |
docker network create -d overlay MyOverlayNetwork |
|---|
| Command for Bridge network | To establish container test1 to bridge demo-bridge, type docker network connect demo-bridge test1. |
docker network create -d bridge MyBridgeNetwork |
|---|
| Command for removing a network | This command s used to remove an overlay network
|
docker network rm MyOverlayNetwork |
|---|
| Command for network listing | This command is used to listing the overlay networks |
docker network ls |
|---|
| Command for Getting Information About a Network | We can get information about an overlay network with the help of this command |
docker network inspect MyOverlayNetwork |
|---|
| Command for Connecting a Running Container to a Network | By using this command we can connect a container to network |
docker network connect MyOverlayNetwork nginx |
|---|
| Command for Connecting a Container to a Network When it Starts | When the container starts we can use this command to connect a container to network |
docker container run -it -d --network=MyOverlayNetwork nginx |
|---|
| Command for Disconnecting a Container from a Network | We can use this Command for disconnecting a container from network |
docker network disconnect MyOverlayNetwork nginx |
|---|
| Command for Exposing Ports | We can expose the empty ports using this command |
EXPOSE <port_number> |
|---|