Introduction
Sometimes you want to make sure a container cannot change its files to keep it safe and stable. Using a read-only filesystem means the container can only read files but cannot write or change them. This helps prevent accidental or harmful changes inside the container.
When running a container that only needs to read data and should not modify it, like a web server serving static files.
When you want to improve security by stopping attackers from changing files if they get access to the container.
When you want to make sure your container behaves the same every time by preventing file changes.
When running containers in production where stability and immutability are important.
When debugging or testing to ensure no files are accidentally changed during the container run.