beginner · bash

Docker and Containers Foundations

Learn how containers package applications, how Docker images and runtimes work, and how to manage networking, storage, orchestration, security, and operational workflows. Progress from core command-line concepts to composing and reasoning about reliable containerized systems.

What you could build

  • A reproducible development environment for a small web service
  • A multi-container application with a web server and database
  • A local monitoring stack for container health and resource usage
  • A containerized command-line data processing pipeline
  • A private image registry workflow for versioned application images

You pick the project at the start — these are examples, not a fixed list.

What you'll be able to do

  • Explain and predict how images, layers, runtimes, processes, networks, volumes, and container lifecycle states work together.
  • Read and write Dockerfiles using build contexts, cache behavior, environment configuration, startup instructions, and multi-stage builds.
  • Diagnose how container networks, published ports, DNS, volumes, bind mounts, and tmpfs storage affect connectivity and data persistence.
  • Interpret and reason through Compose configurations involving service dependencies, healthchecks, profiles, environment interpolation, networks, and volumes.
  • Evaluate container security and operational choices involving users, capabilities, rootless operation, secrets, resource limits, logging, graceful shutdown, updates, and rollbacks.

Who this is for

This course is for developers, system administrators, and technical learners who want a rigorous foundation in Docker and container operations. It fits people who need to package applications, understand runtime behavior, coordinate services with Compose, and reason about secure production practices.

What you should already know

  • Comfort navigating files and directories and running basic commands in a terminal.
  • A basic understanding of applications, processes, environment variables, and client-server communication.
  • Access to a computer where Docker Engine or Docker Desktop can be installed and used.

How a lesson actually goes

Lesson 1
TutorWelcome to Docker and Containers Foundations. We will begin by separating three ideas that are often mixed together: an image is a packaged template, a container is a running instance, and the runtime creates and manages that instance. Before we go further, what do you currently think happens when you run a Docker image?
YouI think Docker starts the image, maybe like launching a virtual machine. The image contains the application, and Docker runs it somewhere isolated.
TutorThat is a useful starting point, especially the idea of isolation. The important correction is that a typical container is not a full virtual machine with its own kernel: its processes share the host kernel while the runtime isolates their filesystem, process, network, and other views. What part of that distinction feels least clear?
YouI understand that the image is not the running thing, but I am unsure how sharing the kernel can still keep one application from seeing everything on the host.
TutorGood—those are two separate mechanisms to keep distinct. The runtime uses operating-system features such as namespaces to give the process an isolated view, while the shared kernel still supplies system-call and resource-management functionality. Later, we will examine network namespaces and container filesystems separately; for now, can you predict whether two containers made from the same image must share the same writable data?
YouI would guess yes because they start from the same image, although I am not sure whether changes to one container change the image too.
TutorThey do not automatically share writable changes, and changing a container does not modify the immutable image. Each container gets its own writable layer above the image layers; when data must outlive that container or be shared deliberately, we use a volume or another mount. We will use that distinction to build a precise model of container lifecycle and storage in the next lessons.

Written from this course's first lesson to show the format — not a recording of a real session.

Course content

marks each module's capstone lesson.

01Container Fundamentals10 lessons

Build a foundation in how containers isolate processes, how images are assembled, and how Docker runtimes manage container execution, networking, and storage.

  • Course Introduction

    Welcome and orientation: overview of the learning path, key outcomes, and how modules build on each other.

  • Containers

    Containers package processes with their required user-space dependencies and run them in isolated environments. Unlike virtual machines, containers generally share the host kernel rather than emulating a complete operating system.

  • Container Images

    A container image contains an application, its dependencies, metadata, and a default startup configuration. Containers are runtime instances created from images.

  • Image Layers

    Images are assembled from ordered, typically read-only layers. Shared layers reduce storage and download costs, while changed build steps create new layers.

  • Container Runtimes

    A container runtime turns an image specification into an executing container by configuring namespaces, resource controls, filesystems, and processes. Docker uses runtime components to coordinate this work.

  • Container Lifecycle

    Containers move through distinct lifecycle states based on runtime operations and the main process. Understanding these states helps distinguish a stopped container from a deleted one.

  • Container Processes

    A container is organized around a primary process, often called PID 1 inside the container. Its signals, child-process behavior, and exit status directly affect container operation.

  • Container Networking

    Container networking uses isolated network interfaces and runtime-managed networks to provide connectivity. Network attachment determines how containers reach one another and the outside world.

  • Container Volumes

    Volumes provide runtime-managed storage that can outlive individual containers. They separate persistent data from the temporary filesystem changes made inside a container.

  • Container Fundamentals Review

    Assess the complete container execution model by tracing a container from image selection through runtime creation, process execution, network connectivity, lifecycle changes, and data persistence.

02Images and Dockerfiles12 lessons

Learn how Dockerfiles define image construction, how build context and instructions affect resulting layers, and how to control container startup behavior, image size, and build efficiency.

  • Dockerfiles

    A Dockerfile is a text file containing ordered instructions for building an image. Its instructions specify the base environment, filesystem changes, configuration, and default runtime behavior.

  • Build Context

    The build context is the set of files sent to the Docker daemon or builder for an image build. Dockerfile instructions that read local files can access only content included in this context.

  • Base Images

    The FROM instruction selects a base image and begins a build stage. The selected base determines the initial filesystem, available tools, architecture compatibility, and inherited metadata.

  • RUN Instruction

    RUN executes a command while the image is being built and records its filesystem changes in a new layer. It is commonly used to install software or create build-time configuration.

  • COPY Instruction

    COPY places selected files or directories from the build context into the image filesystem. Destination paths, ownership, and copied content affect both image behavior and layer contents.

  • WORKDIR Instruction

    WORKDIR changes the working directory for later Dockerfile instructions and for the container's default process. Docker creates the directory if it does not already exist.

  • ENV Instruction

    ENV stores environment variables in image metadata so they are available during later build steps and when containers start. These values can influence software configuration and runtime behavior.

  • CMD Instruction

    CMD defines the default runtime command or default arguments for an image. Runtime arguments can replace or modify CMD, making it a flexible default rather than a mandatory process definition.

  • ENTRYPOINT Instruction

    ENTRYPOINT configures the executable that the container is intended to run. When combined with CMD, ENTRYPOINT commonly supplies the executable while CMD supplies default arguments.

  • Build Cache

    Docker can reuse previously built layers when an instruction and its relevant inputs match a cached result. Once a layer is invalidated, subsequent instructions generally need to be rebuilt.

  • Dockerignore Files

    A .dockerignore file specifies patterns for files and directories omitted from the build context. Excluding unnecessary content can reduce transfer time, prevent accidental inclusion, and improve build-cache behavior.

  • Image Construction Synthesis

    This synthesis connects Dockerfile structure with the image layers and metadata produced during a build. It also evaluates how build context filtering, cache reuse, working directories, environment variables, and startup instructions influence the resulting container.

03Networking and Storage11 lessons

Learn how containers communicate through isolated network interfaces and runtime-managed networks, how external traffic reaches containers, and how writable layers and mount types affect data persistence and lifecycle.

  • Network Namespaces

    A network namespace provides a container with an isolated view of network interfaces, routes, and ports while the host supplies the underlying networking resources.

  • Bridge Networks

    A bridge network acts as a virtual Layer 2 network that connects container interfaces and routes traffic among attached containers through the runtime-managed bridge.

  • Port Publishing

    Port publishing creates a host-to-container forwarding rule so traffic addressed to a host port can reach a service listening on a container port.

  • Container DNS

    Container-aware DNS resolves container or service names to network addresses within a shared runtime-managed network, avoiding dependence on changing container IP addresses.

  • Network Isolation

    Network isolation limits reachability by controlling which networks a container joins and which interfaces, routes, and exposed paths are available to it.

  • Writable Layers

    When a container runs, filesystem changes are written to a container-specific writable layer above the immutable image layers. These changes normally disappear when the container is removed.

  • Volumes

    A volume is runtime-managed storage mounted into a container at a chosen path, allowing data to persist across container replacement and remain separate from the image filesystem.

  • Bind Mounts

    A bind mount maps a specific host file or directory directly into a container, giving the container access to host-managed data at the selected mount path.

  • Tmpfs Mounts

    A tmpfs mount stores files in host memory rather than in the container writable layer or persistent storage, so its contents are temporary and do not survive container removal.

  • Volume Lifecycle

    A volume has a lifecycle independent of any one container: it can be created, mounted by multiple successive containers when appropriate, detached, and explicitly removed.

  • Networking and Storage Synthesis

    Synthesize networking and storage concepts to predict how containers communicate, how traffic reaches services, where filesystem changes are stored, and which data survives container replacement.

04Compose Workflows11 lessons

Learn how Docker Compose models multi-container systems, defines services and their dependencies, configures networks and volumes, manages environment-specific behavior, and controls coordinated runtime operations.

  • Compose Projects

    A Compose project provides a logical boundary for the services, networks, and volumes declared together. Project-scoped resources allow a multi-container system to be created, inspected, and removed coherently.

  • Compose Files

    A Compose file uses YAML declarations to describe services and their supporting resources. Its structure separates the desired system configuration from the commands used to operate it.

  • Service Definitions

    A service definition describes one class of container within the Compose application. Its fields connect image construction or selection with runtime settings such as commands, ports, environment, and storage.

  • Service Dependencies

    Service dependencies express relationships between services that must be considered during orchestration. They can control creation and startup order, but ordering alone does not guarantee that a dependency is ready to accept requests.

  • Healthchecks

    A healthcheck periodically evaluates whether a service is responding according to an explicit test. Health status provides readiness information beyond whether the container's main process is merely running.

  • Compose Networks

    Compose can create and attach services to runtime-managed networks. Network membership determines which services can communicate by name, while published ports determine whether traffic can enter through the host.

  • Compose Volumes

    Compose can declare named volumes and attach them to service paths. The volume's lifecycle is separate from a container's writable layer, allowing data to survive container replacement and, when configured, be shared by services.

  • Environment Interpolation

    Compose can substitute environment-dependent values into fields such as image references, ports, and paths. Understanding the source and timing of those values is essential for predicting the configuration that Compose will apply.

  • Compose Profiles

    Profiles associate optional services with named activation groups. Selecting profiles changes which services Compose includes while leaving the shared application definition in one Compose file.

  • Compose Operations

    Compose operations reconcile the declared application configuration with running containers and project resources. Commands for bringing a stack up or down, viewing logs, and checking status provide coordinated lifecycle control.

  • Compose Workflow Synthesis

    A Compose workflow connects declarative configuration with runtime behavior across an entire multi-container system. Synthesis requires predicting how service definitions, dependencies, healthchecks, resource attachments, variable values, profiles, and operational commands interact.

05Secure Operations11 lessons

Learn how to reduce container security risk and operate containers reliably through identity controls, runtime restrictions, secret handling, image assessment, resource governance, restart behavior, and logs.

  • Container Users

    Container processes can run as a non-root user rather than inheriting root privileges inside the container. The effective user is influenced by image configuration and runtime settings.

  • Rootless Containers

    Rootless operation runs the container engine and containers without requiring host-level root privileges. This reduces the impact of a compromised engine or container, although some features may have limitations.

  • Linux Capabilities

    Linux capabilities divide traditionally broad root privileges into narrower permissions. Container runtimes can drop unnecessary capabilities or add selected ones when a workload requires them.

  • Security Profiles

    Mechanisms such as seccomp and AppArmor apply additional restrictions to container processes. These profiles reduce the system operations and host resources available if a process is compromised.

  • Read-only Filesystems

    A read-only root filesystem prevents processes from changing the container's image-backed filesystem. Temporary or persistent writes must instead use explicitly configured mounts or writable paths.

  • Container Secrets

    Secrets provide sensitive values to a container at runtime without placing them in an image's layers or source-controlled build files. Their exposure, permissions, and lifecycle depend on the runtime or orchestration mechanism.

  • Image Vulnerability Scanning

    Image scanners compare packages and metadata in image layers against vulnerability databases. Findings help identify risk and remediation priorities, but a scan result is time-dependent and does not guarantee runtime safety.

  • Resource Limits

    Resource constraints prevent a container from consuming unlimited host capacity. CPU limits affect available processing time, while memory limits can cause allocation failures or process termination when exceeded.

  • Restart Policies

    Restart policies define whether and under what conditions a runtime attempts to restart a container. They can improve availability but cannot correct an application that repeatedly fails or replace health-aware operational decisions.

  • Container Logs

    Container logs commonly capture the main process's standard output and standard error streams. Logging drivers and operational tooling determine how those records are stored, formatted, rotated, and accessed.

  • Security and Operations Synthesis

    Security and operations controls work together rather than providing independent guarantees. Assess container behavior by connecting least privilege, filesystem and profile restrictions, secret exposure, image risk, resource limits, recovery behavior, and operational evidence.

06Production Patterns9 lessons

Learn patterns for producing smaller, traceable images and operating containerized services with externally supplied configuration, graceful lifecycle behavior, explicit readiness, stateless execution, and controlled updates and rollbacks.

  • Multi-stage Builds

    A multi-stage build uses separate stages for compiling or assembling software and for running it. Selected artifacts can be copied into a later stage so the production image excludes unnecessary tools and dependencies.

  • Image Digests

    A tag is a movable human-readable reference, while a digest identifies a specific image manifest and its content. Using digests makes the image selected for testing, deployment, and rollback explicit and reproducible.

  • Configuration Injection

    Production configuration is supplied when a container runs rather than baked into an image that may be reused across environments. This pattern keeps the image portable and allows configuration values to change without rebuilding the image.

  • Graceful Shutdown

    Graceful shutdown gives the main process an opportunity to stop accepting work, finish or cancel active operations, and release resources. Correct signal handling and an adequate termination window reduce interrupted requests and corrupted state.

  • Stateless Containers

    A stateless container treats its writable filesystem as disposable and keeps durable state in an external data store or managed mount. This allows instances to be replaced, replicated, and rescheduled without losing essential data.

  • Readiness Gates

    Readiness is distinct from process existence: a process may be running while still loading configuration, establishing dependencies, or warming internal state. A readiness gate prevents traffic from reaching a service until its required operating conditions are satisfied.

  • Rolling Updates

    A rolling update introduces instances using a new image version while retiring instances using the previous version in controlled batches. Its safety depends on capacity, readiness checks, compatibility between versions, and the order of replacement.

  • Rollback Strategies

    A rollback restores a previously known-good version when an update causes errors or unacceptable behavior. Reliable rollback requires a traceable prior image, compatible configuration and data expectations, and a way to return traffic to the earlier version.

  • Production Patterns Synthesis

    Production container systems depend on coordinated choices across the build, release, and runtime lifecycle. This synthesis evaluates whether those choices produce images that are small and traceable, services that are replaceable and ready before receiving work, and updates that can be safely reversed.

Questions

Do I need prior Docker experience?

No extensive Docker experience is required. You should be comfortable with a terminal and basic application and process concepts; the course introduces containers, images, runtimes, networking, and storage from first principles.

Will I learn to write Dockerfiles and Compose files?

Yes. You will reason through Dockerfile instructions, build contexts, image layers, cache invalidation, startup configuration, and multi-stage builds, then apply those concepts to Compose service, network, volume, healthcheck, and profile definitions.

Does this course teach Kubernetes?

No. It focuses on Docker and core container foundations, including Docker Compose and production patterns such as readiness, rolling updates, and rollback reasoning. Kubernetes-specific resources and administration are outside the syllabus.

Will security be covered beyond basic permissions?

Yes. The course covers container users, rootless operation, Linux capabilities, security profiles, read-only filesystems, secrets, image vulnerability scanning, resource limits, restart policies, and logging.

Will I learn how containers persist data?

Yes. You will distinguish writable layers, managed volumes, bind mounts, and tmpfs mounts, and predict how attachment, reuse, detachment, and removal affect stored data.

Is this course suitable for production use?

It develops the concepts needed to reason about reliable containerized operations, including immutable image references, configuration injection, graceful shutdown, readiness, updates, and rollback. It is a foundations course rather than a complete guide to operating a particular cloud platform or production infrastructure.

The first lesson is ten minutes away.

Free while codeset is early. You choose what you're building before the first lesson starts, and the course is taught around it.

Start this course

Other courses