Docker Container Networking

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

Each container should serve a single purpose, such as running one application like a web server. Containers can be powerful by themselves, but when connected together, they are far more useful. For example, a web server container can be connected to a database container to provide application storage. Docker provides multiple options for networking containers. In this lab, you’ll explore a few of the common types of networks that Docker supports, and learn how containers within those networks interact.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Explore the Default Network
  1. List the default networks.
  2. Run an httpd container named web1 without specifying a network and see which network it uses.
  3. Attempt to connect to web1 by name and by IP from another container run without a network specified.
Explore Bridge Networks
  1. Create a new bridge network named test_application.
  2. Run an httpd container named web2 in the test_application network.
  3. Attempt to connect to web2 by name and by IP from another container within the test_application network.
  4. Attempt to connect to web1 from a container in the test_application network.
Explore the Host Network
  1. Run an httpd container named web3 on the host network.
  2. Attempt to connect to web3 directly from the server.
  3. Attempt to connect to web3 from another container on the host network.
  4. Attempt to connect to web1 and web2 from a container on the host network.

Additional Resources

Scenario

Thanks to an increase in demand for your services, your organization wants to begin migrating a few applications to containers; to be in a better position to scale with the increase in demand. You will need to ensure that once in containers, the multi-tier applications can still communicate with each other.

Logging in to the lab environment

Log in to the server using the credentials provided:

ssh cloud_user@<PUBLIC_IP_ADDRESS>

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?