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.

Solution: Custom networks and connections

Solution: Custom networks and connections

(upbeat music) - [Instructor] Let's walk through the solution to the challenge. In this challenge, I asked you to create a custom bridge network, run a container, connect and disconnect it from the network, and remove the network. First, I asked you to create a custom bridge network and name it my_custom_bridge_network. This can be accomplished using the Docker network create command and the name my_custom_bridge_network. Then I asked you to run a container named webapp in detached mode with the NGINX image. Do not attach it to the network yet. You can do this using the Docker run command, followed by the D flag, and then name it webapp, and the name of the image, which is nginx. The next step was to connect the network to the running webapp container. The way to do this is to use the Docker network connect command followed by the name of the network, which is my_custom_bridge_network and the name of the container, which is webapp. Then I asked you to disconnect the network from the…

Contents