Port Mapping & Container Networking Basics
Beginner · 30 minutes · 100 points
In this foundational lab, you will learn how Docker container networking works, how to map container ports to host ports, and how to inspect and manage container network configurations. By the end of this lab, you will understand how traffic flows between the host and containers, how to expose services, and how to verify connectivity — core skills for any Docker practitioner.
What you’ll learn
- Understand how Docker port mapping connects container ports to host ports using -p
- Run an Nginx web server container with a specific port binding and verify it is accessible
- Inspect container network settings to identify IP addresses and exposed ports
- Create a custom Docker bridge network and connect containers to it
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: docker:dind
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
Topics: docker, networking, port-mapping, nginx, bridge-network, dns, containers
Create a free account to start this lab.