Docker and CI/CD · Junior · Question 15 of 75
What happens to files written inside a container when you remove it?
- 1Docker moves them into a backup folder on the host
- ✓Correct answer: They are lost unless they were written to a volume
- 3They are saved into the image for the next start
Explanation
The writable layer belongs to the container and is deleted with it. Databases and uploads need a volume or bind mount to outlive the container.