Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support bind-recursive option for bind mounts #11792

Closed
soylent-grin opened this issue May 6, 2024 · 0 comments · Fixed by #12210
Closed

Support bind-recursive option for bind mounts #11792

soylent-grin opened this issue May 6, 2024 · 0 comments · Fixed by #12210

Comments

@soylent-grin
Copy link

Description

Since Docker 25.0.0, the way recursive bind mounts are handled was changed:

In earlier versions of Docker Engine, recursive mounts (submounts) would always be mounted as writable, even when specifying a read-only mount. This behavior has changed in v25.0.0, for hosts running on kernel version 5.12 or later. Now, read-only bind mounts are recursively read-only by default.
To get the same behavior as earlier releases, you can specify the bind-recursive option for the --mount flag.

docker run --mount type=bind,src=SRC,dst=DST,readonly,bind-recursive=writable IMAGE

More on recursive mounts: https://docs.docker.com/storage/bind-mounts/#recursive-mounts

Seems like this is not supported in Compose yet. Would be nice to have something like:

    volumes:
      - type: bind
        source: /mnt
        target: /mnt
        read_only: true
        bind:
          recursive: writable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants