Docker and CI/CD · Senior · Question 4 of 75
Why can appending one line to a 2 GB file in a container be slow?
- 1Docker re-hashes every file in the image after each single write
- 2Containers write all files synchronously over the network
- ✓Correct answer: Overlay storage copies the whole file up to the writable layer first
Explanation
Copy-up happens on the first write to a file from a lower layer. Write-heavy data (databases, logs) belongs in volumes, which bypass the storage driver.