课程: Docker Networking: Creating, Managing, and Troubleshooting Container Networks

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Solution: Networking basics in Docker

Solution: Networking basics in Docker

(upbeat music) - [Instructor] Now let's review the solution for this challenge. First, I asked you to create a new bridge network named my_bridge_network. The answer is to use the docker network create command and pass in the name my_bridge_network. Since bridge is the default driver for Docker networks, you do not need to specify that network type. The next exercise was to verify that the bridge network was created by listing all networks created on your system. You do this using the docker network ls command. This will list all networks that have been created on your system. You can also verify that the driver is bridge. Next, I asked you to run a container and name it frontend. This is done using the docker run command. Connect the container to the my_bridge_network using the network flag and the name of the network, which is my_bridge_network. You also needed to run the container in detached mode, which is done using the -d flag. Mapping port 8080 on the Docker host to TCP port 80…

内容