Implementing a Read Only volume option in the docker-compose.yaml file #341
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change allows users to set a read only flag on volumes in their service containers using the optional
read_only: true
option in the docker-compose.yaml file as defined by the compose specIn specifying this flag it mounts the volume onto the container as read only, meaning the container can not write or change the folder.
Motivation and Context
This change allows for containers to mount read only volumes. This is useful to run a number of different containers as service containers that specify using
:ro
in their documentation.The reason this is often used is primarily a security and system integrity concern. Allowing containers to write where they don't need to can be considered bad practice in certain environments.
How Has This Been Tested?
Read-only file system error
Further, all volumes that are mounted without this option still successfully are able to mount and use their volumes without needing to specify the
read_only
flag meaning it's addition is optional.All make operations ran successfully.
Types of changes
Checklist:
Commits:
git commit -s
for the Developer Certificate of Origin (DCO)Code:
Docs: