Use Run When
You need to create and start a new container from an image.
You want to define ports, env vars, volumes, or startup behavior.
A practical explanation of the difference between starting a container and running a command inside one.
`docker run` starts a new container. `docker exec` runs a command inside an existing container. They sound similar, but they operate on different lifecycles.
You need to create and start a new container from an image.
You want to define ports, env vars, volumes, or startup behavior.
The container is already running and you need to inspect or debug it.
You want a shell or a one-off command inside the running process context.
Run creates. Exec enters.