Your First Docker Containers - Pull, Run, and Manage

Beginner
AutoVerification
IsolatedSandbox
45 mDuration

Pull images from Docker Hub, run named containers with published ports, exec into them, view logs, then stop and remove them cleanly.

Lab Overview & Objectives

Containers package an application together with its filesystem, libraries, and runtime configuration so that the same software runs identically on a laptop, a CI runner, or a production server. Docker, the dominant container runtime, draws a clean line between two ideas that beginners often confuse: an image, which is an immutable, layered template stored in a registry like Docker Hub, and a container, which is a writable, running process instantiated from that image. A single image can spawn dozens of independent container instances, each with its own lifecycle, network ports, and logs - which is what makes Docker such a powerful unit of deployment.

In this lab, you will walk through the everyday lifecycle of a container from start to finish - pulling images from a public registry, running them as named and network-reachable instances, looking at them from both the outside and the inside, and tearing them down so nothing leaks between experiments. By the end you will have the muscle memory for the loop most engineers run dozens of times a day, and a clear mental model of where images, containers, ports, and logs each fit.

Objectives

Upon completion of this beginner level lab, you will be able to:

  • Pull the nginx:alpine and httpd:alpine images from Docker Hub and inspect the local image cache with docker images.
  • Run named, detached containers with -d, --name, and -p flags, then confirm they respond to HTTP requests on their published ports.
  • Inspect running containers using docker ps, docker exec -it, and docker logs to read state from both outside and inside the container.
  • Stop and remove containers cleanly using docker stop and docker rm and verify nothing is left running.

Who is this lab for?

This lab is designed for:

  • Developers running their first container
  • Sysadmins moving from VMs to containers
  • Students or career-changers learning DevOps fundamentals

Real-Time Validation

Our platform uses an automated validation engine to verify your configurations as you work through the lab modules. No multiple choice—just real-world proficiency.

[SYSTEM] VALIDATION_ACTIVEv2.4.0
Checking resource: vpc-ingress-01...
Scanning security policy: allow-ssh...
Modules
5
Duration
45 m

Lab Curriculum

01

Getting Started with Docker IDE

02

Pull Docker Images From Docker Hub

03

Run Named Containers With Published Ports

04

Inspect Containers With Exec and Logs

05

Stop and Remove Running Containers Cleanly