Docker and CI/CD · Junior · Question 32 of 75
What does --rm do in docker run --rm my-app?
- 1Removes the image once the container has started
- 2Removes any previous container with the same name
- ✓Correct answer: Removes the container automatically when it exits
Explanation
Great for one-off commands and tests: no pile of stopped containers. Data in named volumes is kept.