Docker Concepts
Named volumes
Attach separately managed data using a stable volume name. Use an existing verified local lab volume; a missing volume can be created implicitly. Named volumes are not automatically removed by --rm. Mount an empty destination for predictable initial content. Initial population is not continuous synchronization. volume-nocopy disables copying, not mount obscuring.
Formal Syntax & Structure
docker syntaxdocker
--mount type=volume,src=NAME,dst=PATHParameters & Attributes
| Name | Type | Description |
|---|---|---|
| NAME | string | Existing lab volume name. |
| PATH | string | Absolute destination in the container. |
Working Example
Example Snippetdocker
docker run --rm --pull=never --network none --mount type=volume,src=bm-v06-notes,dst=/data,readonly busybox:1.37 ls /data