Docker Concepts

Read-only mounts

Prevent writes through one mount, without making every other location in the container read-only. Other writers may still change the underlying data. Example requires the existing synthetic template volume. Confirm the attempted write actually reached the filesystem and failed, then verify the source remains unchanged.

Formal Syntax & Structure

docker syntaxdocker
--mount type=volume,src=NAME,dst=PATH,readonly

Parameters & Attributes

NameTypeDescription
NAMEstringExisting named volume.
PATHstringMount destination.

Working Example

Example Snippetdocker
docker run --rm --pull=never --network none -v bm-v06-template:/input:ro busybox:1.37 cat /input/note
Docker Reference