StackMonsters

Docker Course · 04

Docker Essentials

Run a Docker Engine in your browser. Start and debug containers, publish ports, build images from a Dockerfile, keep data in volumes, connect containers on networks and run a whole stack with Compose. Every lesson has a quiz and a hands-on lab. Nothing to install.

9
chapters
128
lessons & labs
Chapter 1
free, no account needed
Linux basics
no Docker experience needed

Who it's for

Engineers who need containers to stop being a black box.

  • Sysadmins moving into DevOps who need containers to stop being a black box
  • Backend developers moving toward SRE and platform roles
  • Anyone who has copied a docker run command without knowing what each flag does

What you'll be able to do

Run, build and fix containers with confidence.

  • Run, inspect, debug and remove containers, and read their logs and exit codes
  • Publish ports and configure containers with environment variables and commands
  • Write a Dockerfile, build and tag images, and use the build cache well
  • Keep data in volumes and bind mounts, and connect containers on networks
  • Run a multi-service app with Docker Compose and push images to a registry

The path

9 chapters covering containers, images, volumes, networks and Compose.

Each lesson is short and ends in a quiz, then a lab on a simulated Docker host in your browser. Chapter 1 is free. Finish a chapter to open the next.

  1. 01

    Understand Containers

    Images, containers, registries and your first docker run

    Free
    1. 1Why Applications Need a Consistent Environment6 min
    2. 2Let the Image Choose the RuntimeLab6 min
    3. 3Containers Compared with Virtual Machines7 min
    4. 4Compare the Host and a ContainerLab6 min
    5. 5Images, Containers, and Registries7 min
    6. 6Pull an Image and Run It TwiceLab6 min
    7. 7How the Docker Client and Engine Work7 min
    8. 8Restore Access to the Docker EngineLab7 min
    9. 9Your First Container with docker run8 min
    10. 10Run Your First ContainersLab7 min
    11. 11Challenge: Choose an Image and Run It6 min
    12. 12Choose an Image and Run ItLab10 min
  2. 02

    Manage Containers

    Start, stop, inspect and remove containers

    1. 1List Running and Stopped Containers6 min
    2. 2Take Stock of the Containers on pierLab6 min
    3. 3Name a Container and Run It in the Background6 min
    4. 4Run Named Containers in the BackgroundLab6 min
    5. 5Stop, Start, and Restart Containers7 min
    6. 6Stop, Start and Restart the ServicesLab6 min
    7. 7Why a Container Exits When Its Main Process Ends7 min
    8. 8Keep a Container Alive for the Right ReasonLab6 min
    9. 9Read Application Output with docker logs7 min
    10. 10Read the Logs of Three ContainersLab7 min
    11. 11Run a Command Inside a Container with docker exec7 min
    12. 12Work Inside a Running ContainerLab7 min
    13. 13Remove Containers Without Removing Their Images6 min
    14. 14Clean Up Containers and Keep the ImagesLab6 min
    15. 15Challenge: Diagnose a Container That Keeps Exiting6 min
    16. 16Fix the Worker That Keeps RestartingLab10 min
  3. 03

    Configure a Container

    Ports, environment, commands and inspection

    1. 1Publish a Container Port with -p7 min
    2. 2Publish nginx on the HostLab6 min
    3. 3Host Ports Compared with Container Ports8 min
    4. 4Share Port 80 Across ContainersLab8 min
    5. 5Pass Configuration with -e and --env-file8 min
    6. 6Configure Containers with Environment VariablesLab8 min
    7. 7Override an Image's Default Command8 min
    8. 8Run Other Commands from an ImageLab8 min
    9. 9Use Interactive Input and a Terminal with -it7 min
    10. 10Work Inside Containers with -i and -tLab8 min
    11. 11Inspect Container Configuration and State8 min
    12. 12Answer Questions with docker inspectLab7 min
    13. 13Challenge: Fix a Misconfigured Web Service6 min
    14. 14Fix the Greeter ServiceLab12 min
  4. 04

    Build Your Own Images

    Write a Dockerfile and build an image

    1. 1Read a Dockerfile and Understand the Build Context8 min
    2. 2Build the Status Page from Its DockerfileLab7 min
    3. 3Choose a Base Image with FROM8 min
    4. 4Fix the Base Image TagLab7 min
    5. 5Set a Working Directory and Copy Application Files8 min
    6. 6Copy the App Where CMD Expects ItLab8 min
    7. 7Run Build Steps with RUN8 min
    8. 8Add the Build Steps the App NeedsLab9 min
    9. 9Choose Startup Behavior with CMD and ENTRYPOINT9 min
    10. 10Make the Start Command OverridableLab9 min
    11. 11Document a Port with EXPOSE Without Publishing It6 min
    12. 12Document the Port, Then Publish ItLab8 min
    13. 13Build and Tag an Image with docker build8 min
    14. 14Tag a Release and a Dev BuildLab9 min
    15. 15Understand Layers and Reuse the Build Cache9 min
    16. 16Keep npm install CachedLab9 min
    17. 17Exclude Unneeded Files and Secrets with .dockerignore8 min
    18. 18Keep Secrets Out of the ImageLab8 min
    19. 19Challenge: Package a Supplied Status-Page App6 min
    20. 20Package the Status PageLab15 min
  5. 05

    Keep Data Between Containers

    Volumes, bind mounts and the writable layer

    1. 1Understand a Container's Writable Layer7 min
    2. 2Watch the Writable LayerLab6 min
    3. 3Create and Inspect Named Volumes8 min
    4. 4Share a Named VolumeLab7 min
    5. 5Attach a Volume with --mount8 min
    6. 6Mount Storage into a CI ContainerLab7 min
    7. 7Replace a Container While Keeping Its Data9 min
    8. 8Upgrade Two Redis ContainersLab10 min
    9. 9Use a Bind Mount for Project Files8 min
    10. 10Serve a Project DirectoryLab7 min
    11. 11Understand Read-Only Mounts and Hidden Container Files8 min
    12. 12Fix a Blank Preview ServerLab9 min
    13. 13Challenge: Preserve a Service's Data Through Replacement6 min
    14. 14Move the Orders Database to a Named VolumeLab15 min
  6. 06

    Connect Containers

    Networks, DNS and localhost

    1. 1Understand Docker's Bridge Networks7 min
    2. 2Map the Default BridgeLab6 min
    3. 3Create a User-Defined Network7 min
    4. 4Build the Shop NetworkLab6 min
    5. 5Connect Containers and Resolve Their Names8 min
    6. 6Join the Front End to the Back EndLab7 min
    7. 7Why localhost Refers to the Current Container7 min
    8. 8Replace localhost with Service NamesLab7 min
    9. 9Reach Another Container Without Publishing Its Port7 min
    10. 10Keep the Back End PrivateLab8 min
    11. 11Challenge: Repair an App's Connection to Its Data Service7 min
    12. 12Repair the Visit CounterLab12 min
  7. 07

    Run an Application with Compose

    Define a stack in compose.yaml and run it

    1. 1Read YAML Mappings, Lists, and Indentation7 min
    2. 2Fix a Broken compose.yamlLab8 min
    3. 3Define Services in compose.yaml7 min
    4. 4Write Your First compose.yamlLab7 min
    5. 5Configure Images, Builds, Ports, and Environment8 min
    6. 6Add the Web Service to the StackLab9 min
    7. 7Define Shared Networks and Persistent Volumes8 min
    8. 8Give Postgres a Volume and a NetworkLab10 min
    9. 9Start and Inspect a Stack with docker compose8 min
    10. 10Run and Inspect the Signup StackLab8 min
    11. 11Distinguish .env Substitution from Container Environment8 min
    12. 12Get the Password Into the ContainerLab9 min
    13. 13Understand Startup Order and Readiness Checks8 min
    14. 14Make web Wait for PostgresLab9 min
    15. 15Rebuild Services and Tear Down Without Deleting Data7 min
    16. 16Ship a Code Change, Then Tear Down SafelyLab9 min
    17. 17Challenge: Run a Workshop Signup App and Its Database6 min
    18. 18Challenge: Run the Signup App and Its DatabaseLab15 min
  8. 08

    Share Images and Clean Up

    Tags, digests, registries and pruning

    1. 1Read Image Names, Registry Addresses, and Tags7 min
    2. 2Give One Image Three NamesLab6 min
    3. 3Understand Mutable Tags and Image Digests8 min
    4. 4Roll Back to a DigestLab8 min
    5. 5Tag and Push an Image to a Registry8 min
    6. 6Push the Status Page to Two RegistriesLab8 min
    7. 7Pull and Run a Published Release7 min
    8. 8Deploy Release 1.1.0 from the RegistryLab7 min
    9. 9Remove Unused Images and Volumes Deliberately8 min
    10. 10Reclaim Disk Space Without Losing DataLab10 min
    11. 11Challenge: Publish a New Release and Keep a Rollback Tag6 min
    12. 12Ship 1.1.0 and Keep a Way BackLab12 min
  9. 09

    Final Challenge: Recover a Broken Stack

    Fix an unfamiliar stack end to end

    1. 1Inspect the Supplied Stack and Read Its Logs6 min
    2. 2Investigate the Broken Signup StackLab8 min
    3. 3Fix a Dockerfile and Rebuild the Application6 min
    4. 4Fix the Dockerfile and Rebuild webLab8 min
    5. 5Repair a Port Mapping and Service Hostname6 min
    6. 6Repair the Port Mapping and DB_HOSTLab8 min
    7. 7Restore Persistent Storage and Missing Configuration7 min
    8. 8Restore Storage and the Missing .envLab10 min
    9. 9Verify the App Works After Containers Are Recreated6 min
    10. 10Redeploy and Prove the Data SurvivesLab8 min