📦docker run
Also known as docker run Command, docker container run, Run a Container
The command that makes a new box from an image and starts it.
Think of it like
Think of it like pressing play. The same song starts fresh each time.
Example
Why it matters
It is the first command most people learn. Nearly every way of starting a container comes back to it.
Definition
Example code
console
$ docker run --rm hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.Common mistake
Key takeaways
- 1New every time. Each run makes a fresh container.
- 2Pulls if needed. Downloads the image when it is missing.
- 3Flags shape it. -d, -p, --name and more.