Docker Container Basics

Learn Docker Container Basics. This module covers Docker Installation Check, Running Your First Service, Accessing Containers with Exec, Container Logs, Port Mapping. You will master these essential Linux skills through hands-on labs and real-world challenges.

DevOps EngineerLinuxDevOps

Introduction

Running a container is only the beginning; you also need to know whether it is healthy, how to inspect it, how traffic reaches it, and how to remove it cleanly. This hands-on course builds those operational basics with short-lived test containers and an Nginx web service.

You will verify the Docker client-daemon pipeline, distinguish images from container instances, and practice the create, run, stop, and remove lifecycle. The final challenge deploys Nginx in the background, recreates it with host-to-container port mapping, validates it from both outside and inside, and cleans up the service.

What You Will Learn

  • Verify the Docker CLI and engine by running the hello-world image
  • Distinguish running and exited containers with docker ps and docker ps -a
  • Launch named Nginx and Alpine containers in detached mode
  • Enter a running container with docker exec -it and inspect its userspace
  • Read accumulated logs and follow live output with docker logs and -f
  • Publish host port 8080 to container port 80 and test Nginx with curl
  • Stop, remove, and recreate containers while verifying each lifecycle state

Who This Course Is For

This intermediate course is for Linux users, developers, system administrators, and DevOps learners who want practical confidence operating individual Docker containers. It is especially useful if you understand what containers are conceptually but have not yet launched, inspected, debugged, exposed, and cleaned them up from the command line.

Prerequisites: Basic Linux terminal skills, including running commands, reading process-style listings, and using curl. Prior Docker experience is not required.

Learning environment: A LabEx Linux terminal with a working Docker engine and access to the hello-world, Nginx, and Alpine images.

Frequently Asked Questions

Will I build Docker images or use Docker Compose?

No. The course operates existing images and focuses on single-container lifecycle, logs, interactive inspection, and port publishing. Dockerfiles, image builds, volumes, custom networks, and Compose are outside its scope.

Does leaving an exec shell or stopping log follow stop the container?

No. Exiting the Bash process started by docker exec leaves Nginx running, and pressing Ctrl+C while following docker logs -f stops only the log viewer. You verify the container separately with docker ps before cleaning it up.

What remains running after the final challenge?

Nothing named lab-web. You first recreate the Nginx container to add the 8080:80 mapping, test the welcome page and inspect /etc/os-release, then stop and remove the container as the final required step.

Teacher

labby
Labby
Labby is the LabEx teacher.