Articles → DOCKER → How To Connect And Disconnect A Docker Container To A Network

How To Connect And Disconnect A Docker Container To A Network






Network And Containers




  1. Both containers should be in the same network
  2. Container should be connected to the network of the other container

Prerequisite





Docker Network Connect Command




docker network connect [network name] [Container name]


Picture showing the execution of docker network connect command
Click to Enlarge


Docker Network Disconnect Command




docker network disconnect [network name] [Container name]


Picture showing the execution of docker network disconnect command
Click to Enlarge




Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, April 18, 2023

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250