docker -v host_dir:container_dir ...
I know from the above, when we're running scripts inside the container, writing to container_dir copies the written files to host_dir. But are all host_dir files also synced into the container?
docker -v host_dir:container_dir ...
I know from the above, when we're running scripts inside the container, writing to container_dir copies the written files to host_dir. But are all host_dir files also synced into the container?
By default it is mounted as rw (read-write mode) , Howver in case you need a readonly volume it is possible.
docker run -v volume-name:/path/in/container:ro my/image
In Docker-Compose
version: "3"
services:
redis:
image: redis:alpine
read_only: true
Take reference : Docker, mount volumes as readonly