Docker Run: Master the docker run Command
Intermediate · 30 minutes · 100 points
Dive deep into the `docker run` command and its most important options. You will learn how to control container behavior using flags for naming, port mapping, environment variables, volume mounts, resource limits, and detached vs interactive modes. By the end of this lab you will be comfortable crafting `docker run` commands for real-world scenarios.
What you’ll learn
- Run containers in detached and interactive modes using docker run flags
- Configure containers with environment variables, port mappings, and named volumes
- Apply resource constraints and custom restart policies to containers
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 3 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, docker-run, containers, devops, cli, volumes, resource-limits, networking
Create a free account to start this lab.