- What is the difference between docker run and docker start?
- docker run creates and starts a new container from an image. docker start restarts an existing stopped container. For development workflows, docker run is most common; docker start is used when you want to resume a previously created container with its existing filesystem.
- When should I use docker exec vs docker run for debugging?
- docker exec runs a command inside an already-running container — use it to inspect a live service (exec -it <container> bash). docker run starts a new container from an image — use it for one-off debugging without affecting the running service.
- What does --rm do and should I always use it?
- --rm removes the container filesystem when it exits. Use it for temporary containers (one-off scripts, build steps) to prevent accumulating stopped containers. Do not use --rm for containers you may want to restart or inspect after they exit.