0
  1. How do I know I need to add the ro or not?
  2. I know the ro stands for read only but why would you need a read only bind mount?
  3. How would it effect my docker-composer-yml

Example: Containerizing a python app

// docker-composer.yml
...
volumes:
    - ./src:/usr/src/app/src:ro
Andrew
  • 1
  • 1

1 Answers1

1

ro means read-only: https://docs.docker.com/engine/reference/run/#volume-shared-filesystems

-v, --volume=[host-src:]container-dest[:<options>]: Bind mount a volume.
The comma-delimited `options` are [rw|ro], [z|Z],
[[r]shared|[r]slave|[r]private], and [nocopy].
The 'host-src' is an absolute path or a name value.

If neither 'rw' or 'ro' is specified then the volume is mounted in
read-write mode.

The `nocopy` mode is used to disable automatically copying the requested volume
path in the container to the volume storage location.
For named volumes, `copy` is the default mode. Copy modes are not supported
for bind-mounted volumes.

--volumes-from="": Mount all volumes from the given container(s)
mgutt
  • 503
  • 1
  • 7
  • 24