Run your first Docker container
Quick answer
Use docker run to create and start a container from an image. In an approved disposable Linux-container lab, a reviewed, preloaded hello-world image provides a simple first engine and execution check.
Run and observe
Confirm the effective lab context and permissions as in the previous lesson. The lab owner must supply a trusted local hello-world:latest image with recorded digest and platform; the tag is mutable. --pull=never fails if the image is missing rather than fetching it. --network none disables external container networking; it does not control the CLI-to-engine connection. --rm removes the container and any associated anonymous volumes after exit. No host paths or ports are used here. If the image or isolation is not approved, do not run the command; predict the result instead.
docker run --rm --pull=never --network none hello-world:latestWhat should happen?
The reviewed greeting program is expected to print a message including Hello from Docker! and finish successfully. Docker removes the container; the image remains available unless separately removed. A missing local image produces a launch error, not an application crash. The greeting and exact output depend on the approved image. These are predictions, not authoring-environment execution results.
Try it yourself
Predict the result of two runs with the same preloaded image, including whether either run creates a persistent stopped container. If the lab is approved, run twice and compare; if the image is absent, stop and ask the lab owner rather than enabling a pull.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Run your first Docker container — knowledge check
Check understanding of the lesson concepts.
In the greeting lab with no mounted volumes, what does --rm remove on exit?
Why does hello-world stop shortly after running?