From the course: Docker Networking: Creating, Managing, and Troubleshooting Container Networks

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Managing network connections

Managing network connections

- [Instructor] Until now, we've added the network to our containers using the docker run command. In this video, we'll focus on connecting and disconnecting containers from Docker networks using multiple networks, and best practices for organizing and securing your containerized environment. The Nginx, MySQL, and Redis containers from the previous video should still be running. First, let's create a new network named custom_bridge2 using the docker network create command. We can connect the existing web server container to this network using the docker network connect command, then the name of the network and the name of the container. In Docker Desktop, click on the running webserver container and click the Inspect tab at the top of the screen. Click on Networks. Here, you can see that the webserver container is using both networks that we've created. Attaching a network to multiple networks refines communication, enhances security, and supports a modular architecture. It can serve…

Contents