Back to the blog Security and reliability

Can Your Dockerized Application Run With a Read-Only Filesystem? A Practical Readiness Checklist

A read-only container root filesystem can limit unintended writes, but only if the application’s write paths are understood and tested. Use this checklist to identify what needs storage, verify platform support, and plan a safe rollout.

Checklist for testing application write paths before enabling a read-only Docker container filesystem

What a read-only root filesystem changes

Docker’s --read-only option mounts the container’s root filesystem as read-only. An application that tries to write to that filesystem cannot complete that write. This can limit unintended changes to the container’s filesystem, but it is a compatibility measure to verify—not a universal hardening switch.

Separately mounted volumes and tmpfs mounts are not part of the root filesystem and can still be writable. The setting does not make those mounts read-only or protect their data, and it does not protect the network. Treat it as one bounded security measure, not a complete security boundary.

  • Identify every location the application needs to write to, rather than assuming it only writes to its main data directory.
  • Decide whether each write must persist beyond the container’s lifetime or is temporary.
  • Check whether your deployment environment lets you enable the setting and configure the necessary mounts.
What a read-only root filesystem changes

Inventory the application’s write paths

Start with the actual application and deployment configuration. Common write categories include uploads and application state, temporary files, caches, PID files, sockets, on-disk logs, and configuration that the application generates or modifies. The specific paths vary, so do not treat conventions from another application as proof.

Record each path or path category, what writes there, and whether the contents need to survive a restart or replacement of the container. A short, evidence-based list is more useful than making broad directories writable “just in case.”

Match the storage to the data

For data that must persist, use an appropriate persistent volume and confirm its lifecycle, access requirements, and backup or recovery arrangements. A tmpfs is temporary: its contents are in memory and are emptied when the container shuts down, so it is not a substitute for persistent application data.

For temporary runtime needs, a temporary mount may be suitable if the application supports it and losing its contents at shutdown is acceptable. Where the application supports changing its write location, redirect it to a mounted path rather than making a broader part of the root filesystem writable.

  • For every proposed mount, document the path, purpose, persistence requirement, and access requirements.
  • Keep writable mounts limited to identified needs; do not make persistent application data temporary.
  • Check whether logs are written to files or handled another way in your deployment, and include any on-disk log paths in the inventory.

Use documentation, then verify behavior

Check the application’s documentation and your deployment configuration for supported write locations, relevant settings, and required mounts. Documentation can establish what is intended for a particular application and deployment, but it does not replace testing the configuration you actually run.

If a path or behavior is undocumented, record it as uncertain. Exercise the service in a non-production environment and inspect changes or errors. Docker’s docker diff can help show filesystem changes in a tested container, but a test only covers the activity you exercised; it is not proof that every possible workflow has been covered.

  • Test normal startup and shutdown, not just whether the container starts.
  • Include representative user actions, uploads or edits, background jobs, and any other workflows that matter to your operation.
  • Treat a read-only filesystem error as a clue to investigate the required path, not as a reason to make the whole root filesystem writable by default.
Inventory the application’s write paths

Test essential workflows before changing production

Apply the read-only setting and the candidate mounts in a non-production environment that resembles your intended deployment. Re-run the activity that exposed a write requirement after configuring its mount or supported application setting, then exercise the rest of your representative workflows.

Include upgrade procedures, scheduled or background work, and recovery scenarios that are part of your operating routine. Check for failed writes and confirm that important data remains available where expected. A successful startup alone is not a readiness test.

  • Confirm the application starts and completes normal user workflows.
  • Run relevant background jobs and check that their outputs and logs behave as expected.
  • Test an upgrade and a recovery procedure, including the data those procedures depend on.
  • After changing a mount or write-location setting, rerun the workflow that failed and verify the fix rather than assuming the configuration is sufficient.

Confirm the deployment can support the design

Before rollout, confirm that the specific hosting and deployment environment exposes the read-only root setting and the mount controls you need. A managed service does not, by itself, establish whether this setting is available or suitable for your application. Platform policies or deployment constraints may also affect which configuration is accepted.

For Airbip deployments, application instances run as Docker workloads on Airbip cloud servers, and Airbip provides service lifecycle management and configurable daily, weekly, and monthly backups. Those capabilities do not confirm that a particular instance exposes a read-only root setting or that a specific application is compatible with it. Check the available deployment controls and application requirements before relying on this configuration.

  • Verify that the root filesystem setting is available for the particular deployment.
  • Verify that required writable mounts can be configured at the paths the application uses.
  • Confirm the mount’s persistence and access behavior, and how it fits with your backup and recovery choices.
  • If the control or application support is unclear, ask the hosting provider or application maintainer before adopting the change.

Roll out with monitoring and a rollback plan

Document the tested configuration, the paths that remain writable, and why each one is required. Roll out the change in a controlled way and monitor startup, essential workflows, background jobs, and signs of failed writes. This makes unexpected incompatibilities easier to detect than enabling the setting without a record of the application’s expected behavior.

Define how you will revert the setting if a critical workflow fails, and how you will protect or recover any data written to mounted storage. Keep backup and restore responsibilities explicit: a read-only root filesystem does not protect writable mount contents.

  • Record the working configuration and the evidence that its required workflows passed.
  • Watch for read-only filesystem errors and failures in user-facing or background tasks.
  • If you need to roll back, confirm that the application is working again and that data on writable mounts remains available.
  • Revisit the inventory when application configuration or deployment behavior changes.

Frequently asked questions

Does a read-only Docker root filesystem make the whole container read-only?

No. It makes the container’s root filesystem read-only, but separately mounted volumes and tmpfs mounts can remain writable. Configure and assess those mounts separately.

Does read-only mode protect application data?

Not by itself. Writable mounts can still be changed, and the setting does not protect their contents. Choose appropriate persistent storage and maintain backup and recovery arrangements for data that matters.

How can I find out which paths an application needs to write to?

Check the application and deployment documentation, then exercise representative workflows with the read-only setting in a non-production environment. Inspect filesystem changes or errors, and treat undocumented behavior as uncertainty until verified.

Should temporary files go on a persistent volume or tmpfs?

Choose based on whether the contents must survive container shutdown. A tmpfs is temporary and its contents are emptied at shutdown; use appropriate persistent storage for data that must remain available.

Does managed hosting mean I can enable this setting?

No. Managed status alone does not establish that the setting or required mount controls are available, or that the application is compatible. Confirm the controls and requirements for your specific deployment.

Sources and further reading 6